Inter prediction method and apparatus for same

ABSTRACT

According to the present invention, an image encoding apparatus comprises: a motion prediction unit which derives motion information on a current block in the form of the motion information including L0 motion information and L1 motion information; a motion compensation unit which performs a motion compensation for the current block on the basis of at least one of the L0 motion information and L1 motion information so as to generate a prediction block corresponding to the current block; and a restoration block generating unit which generates a restoration block corresponding to the current block based on the prediction block. According to the present invention, image encoding efficiency can be improved.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a Continuation Application of U.S. application Ser.No. 15/706,884 filed on Sep. 18, 2017, which is a ContinuationApplication of U.S. application Ser. No. 14/131,734 filed on Jan. 9,2014, now U.S. Pat. No. 9,819,963 issued on Nov. 14, 2017, which is aU.S. national stage application of International Application No.PCT/KR2012/005531 filed on Jul. 12, 2012, which claims the benefit ofKorean Application Nos. 10-2012-0075901, 10-2011-0082395,10-2011-0071658, 10-2011-0071171, 10-2011-0069166 filed on Jul. 12,2012, Aug. 18, 2011, Jul. 19, 2011, Jul. 18, 2011, and Jul. 12, 2011,the entire disclosures of which are incorporated herein by reference forall purposes.

TECHNICAL FIELD

The present invention relates to image processing, and moreparticularly, to an inter prediction method and apparatus.

BACKGROUND ART

Recently, in accordance with the expansion of broadcasting serviceshaving high definition (HD) resolution in the country and around theworld, many users have been accustomed to a high resolution anddefinition image, such that many organizations have attempted to developthe next-generation video devices. In addition, as the interest in HDTVand ultra high definition (UHD) having a resolution four times higherthan that of HDTV have increased, a compression technology for ahigher-resolution and higher-definition image has been demanded.

For image compression, an inter prediction technology of predictingpixel values included in a current picture from a picture before and/orafter the current picture, an intra prediction technology of predictingpixel values included in a current picture using pixel information inthe current picture, an entropy encoding technology of allocating ashort code to symbols having a high appearance frequency and a long codeto symbols having a low appearance frequency, or the like, may be used.

DISCLOSURE Technical Problem

The present invention provides an image encoding method and apparatuscapable of improving image encoding efficiency.

The present invention also provides an image decoding method andapparatus capable of improving image encoding efficiency.

The present invention also provides an inter prediction method andapparatus capable of improving image encoding efficiency.

The present invention also provides a method and apparatus of derivingmotion information capable of improving image encoding efficiency.

The present invention also provides a method and apparatus of derivingtemporal motion information capable of improving image encodingefficiency.

Technical Solution

In an aspect, an image decoding apparatus is provided. The imagedecoding apparatus includes: a motion estimating unit deriving motioninformation of a current block as motion information including L0 motioninformation and L1 motion information; a motion compensating unitperforming motion compensation on the current block based on at leastone of the L0 motion information and the L1 motion information togenerate a prediction block corresponding to the current block; and areconstructed block generating unit generating a reconstructed blockcorresponding to the current block based on the prediction block,wherein the motion compensating unit perform the motion compensationbased on whether or not the L0 motion information and the L1 motioninformation are the same as each other.

The L0 motion information may include an L0 motion vector and an L0reference picture number, wherein the L0 reference picture numberindicates a picture order count (POC) allocated to an L0 referencepicture, and the L1 motion information may include an L1 motion vectorand an L1 reference picture number, wherein the L1 reference picturenumber indicates a picture order count (POC) allocated to an L1reference picture.

In the case in which the L0 motion vector and the L1 motion vector arethe same as each other and the L0 reference picture number and the L1reference picture number are the same as each other, the motioncompensating unit may perform uni-prediction based on the L0 motioninformation of the L0 motion information and the L1 motion information.

In the case in which the L0 motion vector and the L1 motion vector arenot the same as each other or the L0 reference picture number and the L1reference picture number are not the same as each other, the motioncompensating unit may perform bi-prediction based on the L0 motioninformation and the L1 motion information.

In another aspect, an image decoding apparatus is provided. The imagedecoding apparatus includes: a motion estimating unit deriving motioninformation of a current block as motion information including L0 motioninformation and L1 motion information; a motion compensating unitperforming motion compensation on the current block based on at leastone of the L0 motion information and the L1 motion information togenerate a prediction block corresponding to the current block; and areconstructed block generating unit generating a reconstructed blockcorresponding to the current block based on the prediction block,wherein the motion compensating unit perform the motion compensationbased on a size of the current block.

In the case in which the size of the current block is smaller than apredetermined size, the motion compensating unit may performuni-prediction based on the L0 motion information of the L0 motioninformation and the L1 motion information.

The predetermined size may be 8×8.

In still another aspect, an image decoding apparatus is provided. Theimage decoding apparatus includes: a motion estimating unit derivingmotion information from a previously reconstructed picture; a motioncompensating unit generating a prediction block corresponding to acurrent block based on the derived motion information; and areconstructed block generating unit generating a reconstructed blockcorresponding to the current block based on the prediction block,wherein the motion information includes a motion vector and a referencepicture index, and wherein the motion estimating unit sets the referencepicture index to 0 and derives the motion vector based on a collocatedblock corresponding to the current block within the previouslyreconstructed picture.

An encoding mode of the current block may be a merge mode, and themotion compensating unit may select temporal motion information asmotion information of the current block and perform motion compensationbased on the selected motion information to generate the predictionblock corresponding to the current block.

Advantageous Effects

With the image encoding method according to the present invention, imageencoding efficiency may be improved.

With the image decoding method according to the present invention, imageencoding efficiency may be improved.

With the inter prediction method according to the present invention,image encoding efficiency may be improved.

With the method of deriving motion information according to the presentinvention, image encoding efficiency may be improved.

With the method of deriving temporal motion information according to thepresent invention, image encoding efficiency may be improved.

DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram showing a configuration of an embodiment of animage encoding apparatus according to the present invention.

FIG. 2 is a block diagram showing a configuration of an embodiment of animage decoding apparatus according to an embodiment of the presentinvention.

FIG. 3 is a flow chart schematically showing an embodiment of an interprediction method.

FIG. 4 is a diagram schematically showing an embodiment of an interprediction method in the case in which bi-direction prediction isapplied.

FIG. 5 is a diagram schematically showing an embodiment of motioninformation of an encoded picture.

FIG. 6 is a flow chart schematically showing an embodiment of a methodof deriving temporal motion information of a current block according tothe present invention.

FIG. 7 is a diagram schematically showing an embodiment of reconstructedneighboring blocks used to reset L1 temporal motion information.

FIG. 8 is a block diagram schematically showing an embodiment of aninter prediction apparatus capable of performing the process of derivingtemporal motion information according to the embodiment of FIG. 6.

FIG. 9 is a flow chart schematically showing another embodiment of amethod of deriving temporal motion information of a current blockaccording to the present invention.

FIG. 10 is a diagram schematically showing an embodiment of a secondcollocated block used to reset L1 temporal motion information.

FIG. 11 is a block diagram schematically showing an embodiment of aninter prediction apparatus capable of performing the process of derivingtemporal motion information according to the embodiment of FIG. 9.

FIG. 12 is a flow chart schematically showing an embodiment of a methodof deriving motion information of a current block according to thepresent invention.

FIG. 13 is a block diagram schematically showing an embodiment of aninter prediction apparatus capable of performing the process of derivingmotion information according to the embodiment of FIG. 12.

FIG. 14 is a flow chart schematically showing still another embodimentof a method of deriving temporal motion information of a current blockaccording to the present invention.

FIG. 15 is a block diagram schematically showing an embodiment of aninter prediction apparatus capable of performing the process of derivingtemporal motion information according to the embodiment of FIG. 14.

MODE FOR INVENTION

Hereinafter, embodiments of the present invention will be described indetail with reference to the accompanying drawings. In describingembodiments of the present invention, well-known functions orconstructions will not be described in detail since they mayunnecessarily obscure the understanding of the present invention.

It will be understood that when an element is simply referred to asbeing ‘connected to’ or ‘coupled to’ another element without being‘directly connected to’ or ‘directly coupled to’ another element in thepresent description, it may be ‘directly connected to’ or ‘directlycoupled to’ another element or be connected to or coupled to anotherelement, having the other element intervening therebetween. Further, inthe present invention, “comprising” a specific configuration will beunderstood that additional configuration may also be included in theembodiments or the scope of the technical idea of the present invention.

Terms used in the specification, ‘first’, ‘second’, etc. can be used todescribe various components, but the components are not to be construedas being limited to the terms. The terms are only used to differentiateone component from other components. For example, the ‘first’ componentmay be named the ‘second’ component and the ‘second’ component may alsobe similarly named the ‘first’ component, without departing from thescope of the present invention.

Furthermore, constitutional parts shown in the embodiments of thepresent invention are independently shown so as to represent differentcharacteristic functions. Thus, it does not mean that eachconstitutional unit is constituted in a constitutional unit of separatedhardware or one software. In other words, each constitutional unitincludes each of enumerated constitutional parts for convenience ofexplanation. Thus, at least two constitutional parts of eachconstitutional unit may be combined to form one constitutional unit orone constitutional unit may be divided into a plurality ofconstitutional parts to perform each function. The embodiment where eachconstitutional unit is combined and the embodiment where oneconstitutional unit is divided are also included in the scope of thepresent invention, if not departing from the essence of the presentinvention.

In addition, some of constituents may not be indispensable constituentsperforming essential functions of the present invention but be selectiveconstituents improving only performance thereof. The present inventionmay be implemented by including only the indispensable constitutionalparts for implementing the essence of the present invention except theconstituents used in improving performance. The structure including onlythe indispensable constituents except the selective constituents used inimproving only performance is also included in the scope of the presentinvention. FIG. 1 is a block diagram showing a configuration of anembodiment of an image encoding apparatus according to the presentinvention.

Referring to FIG. 1, the image encoding apparatus 100 includes a motionestimator 111, a motion compensator 112, an intra predictor 120, aswitch 115, a subtracter 125, a transformer 130, a quantizer 140, anentropy encoder 150, a dequantizer 160, an inverse transformer 170, anadder 175, a filter unit 180, and a reference picture buffer 190.

The image encoding apparatus 100 may perform encoding on input picturesin an intra-mode or an inter-mode and output bit streams. The intraprediction means intra-frame prediction and the inter prediction meansinter-frame prediction. In the case of the intra mode, the switch 115may be switched to intra, and in the case of the inter mode, the switch115 may be switched to inter. The image encoding apparatus 100 maygenerate a prediction block for an input block of the input pictures andthen encode a residual between the input block and the prediction block.

In the case of the intra mode, the intra predictor 120 may performspatial prediction using pixel values of previously encoded blocksneighboring to a current block to generate the prediction block.

In the case of the inter mode, the motion estimator 111 may search aregion optimally matched with the input block in a reference picturestored in the reference picture buffer 190 during a motion estimationprocess to obtain a motion vector. The motion compensator 112 mayperform motion compensation using the motion vector to generate theprediction block.

The subtracter 125 may generate a residual block by the residual betweenthe input block and the generated prediction block. The transformer 130may perform transform on the residual block to output transformcoefficients. Further, the quantizer 140 may quantize the inputtransform coefficient according to quantization parameters to output aquantized coefficient.

The entropy encoding unit 150 may perform entropy encoding according toprobability distribution based on values (for example, the quantizedcoefficient) calculated in the quantizer 140 or encoding parametervalues, or the like, calculated during the encoding process to outputbit streams.

When the entropy encoding is applied, symbols are represented byallocating a small number of bits to symbols having high generationprobability and allocating a large number of bits to symbols having lowgeneration probability, thereby making it possible to reduce a size ofbit streams for the encoding target symbols. Therefore, the compressionperformance of the picture encoding may be improved through the entropyencoding. The entropy encoder 150 may use an encoding method such asexponential golomb, context-adaptive variable length coding (CAVLC),context-adaptive binary arithmetic coding (CABAC), or the like, for theentropy encoding.

Since the image encoding apparatus according to the embodiment of FIG. 1performs inter prediction encoding, that is, inter-frame predictionencoding, a current encoded picture needs to be decoded and stored inorder to be used as a reference picture. Therefore, the quantizedcoefficient is dequantized in the dequantizer 160 and inverselytransformed in the inverse transformer 170. The dequantized andinversely transformed coefficient is added to the prediction blockthrough the adder 175, such that a reconstructed block is generated.

The reconstructed block passes through the filter unit 180 and thefilter unit 180 may apply at least one of a deblocking filter, a sampleadaptive offset (SAO), and an adaptive loop filter (ALF) to areconstructed block or a reconstructed picture. The filter unit 180 mayalso be called an adaptive in-loop filter. The deblocking filter mayremove a block distortion and/or a blocking artifact generated at aboundary between blocks. The SAO may add an appropriate offset value toa pixel value in order to compensate an encoding error. The ALF mayperform the filtering based on a comparison value between thereconstructed picture and the original picture and may also operate onlywhen a high efficiency is applied. The reconstructed block passingthrough the filter unit 180 may be stored in the reference picturebuffer 190.

FIG. 2 is a block diagram showing a configuration of an embodiment of animage decoding apparatus according to the present invention.

Referring to FIG. 2, an image decoding apparatus 200 includes an entropydecoder 210, a dequantizer 220, an inverse transformer 230, an intrapredictor 240, a motion compensator 250, an adder 255, a filter unit260, and a reference picture buffer 270.

The image decoding apparatus 200 may receive the bit streams output fromthe encoder to perform the decoding in the intra mode or the inter modeand output the reconstructed picture, that is, the reconstructedpicture. In the case of the intra mode, the switch may be switched tothe intra, and in the case of the inter mode, the switch may be switchedto the inter. The image decoding apparatus 200 may obtain a residualblock from the received bit streams, generate the prediction block, andthen add the residual block to the prediction block to generate thereconstructed block, that is, the reconstructed block.

The entropy decoder 210 may entropy-decode the input bit streamsaccording to the probability distribution to generate symbols includinga quantized coefficient type of symbols. The entropy decoding method issimilar to the above-mentioned entropy encoding method.

When the entropy decoding method is applied, symbols are represented byallocating a small number of bits to symbols having high generationprobability and allocating a large number of bits to symbols having lowgeneration probability, thereby making it possible to reduce a size ofbit streams for each symbol. Therefore, the image decoding compressionperformance may be improved through the entropy decoding method.

The quantized coefficients may be dequantized in the dequantizer 220 andbe inversely transformed in the inverse transformer 230. The quantizedcoefficients are dequantized/inversely transformed, such that theresidual block may be generated.

In the case of the intra mode, the intra predictor 240 may performspatial prediction using pixel values of previously decoded blocksneighboring to a current block to generate prediction blocks. In thecase of the inter mode, the motion compensator 250 may perform themotion compensation by using the motion vector and the reference picturestored in the reference picture buffer 270 to generate the predictionblock.

The residual block and the prediction block may be added to each otherthrough the adder 255 and the added block may pass through the filterunit 260. The filter unit 260 may apply at least one of the deblockingfilter, the SAO, and the ALF to the reconstructed block or thereconstructed picture. The filter unit 260 may output the reconstructedpictures, that is, the reconstructed picture. The reconstructed picturemay be stored in the reference picture buffer 270 to thereby be used forthe inter prediction.

Hereinafter, the block means a unit of the picture encoding anddecoding. At the time of the picture encoding and decoding, the encodingor decoding unit means the divided unit when the picture is divided andthen encoded or decoded. Therefore, the unit may be called a coding unit(CU), a prediction unit (PU), a transform unit (TU), a transform block,or the like. One block may be further divided into sub-blocks having asmaller size. In addition, a “picture” in the present specification maybe replaced by a “frame”, a “field”, and/or a “slice” according to acontext. These terms may be easily distinguished from each other bythose skilled in the art. For example, a P picture, a B picture, and aforward B picture to be described below may be replaced with a P slice,a B slice, and a forward B slice, respectively.

FIG. 3 is a flow chart schematically showing an embodiment of an interprediction method.

Referring to FIG. 3, an encoder and a decoder may derive motioninformation on a current block (S310).

In the inter mode, the encoder and the decoder may derive the motioninformation on the current block and then perform inter predictionand/or motion compensation based on the derived motion information. Inthis case, the encoder and the decoder use motion information ofreconstructed neighboring blocks and/or collocated blocks correspondingto the current block within a previously reconstructed collocatedpicture, thereby making it possible to improve encoding/decodingefficiency. Here, the reconstructed neighboring block, which is a blockin a previously encoded and/or decoded and reconstructed currentpicture, may include blocks adjacent to the current block and/or blockspositioned at an outer corner of the current block. In addition, theencoder and the decoder may determine a predetermined relative positionbased on a block present at the spatially same position as that of thecurrent block in the collocated picture and derive the collocated blockbased on the determined predetermined relative position (positions of aninner portion and/or an outer portion of the block present at thespatially same position as that of the current block). Here, forexample, the collocated picture may correspond to one of referencepictures included in a reference picture list.

Meanwhile, a scheme of deriving motion information may be changedaccording to a prediction mode of the current block. As a predictionmode applied to the inter prediction, there may be an advanced motionvector predictor (AMVP), a merge, or the like.

As an example, in the case in which the AMVP is applied, the encoder andthe decoder may generate a prediction motion vector candidate list usinga motion vector of the reconstructed neighboring block and/or a motionvector of the collocated block. That is, the motion vector of thereconstructed neighboring block and/or the motion vector of thecollocated block may be used as prediction motion vector candidates. Theencoder may transmit a prediction motion vector index indicating anoptimal prediction motion vector selected among the prediction motionvector candidates included in the list. In this case, the encoder mayselect the prediction motion vector of the current block among theprediction motion vector candidates included in the prediction motionvector candidate list using the prediction motion vector index.

The encoder may calculate a motion vector difference (MVD) between themotion vector of the current block and the prediction motion vector,encode the calculated MVD, and transmit the encoded MVD to the decoder.In this case, the decoder may decode the received MVD and sum thedecoded MVD and the prediction motion vector to derive the motion vectorof the current block.

As another example, in the case in which the merge is applied, theencoder and the decoder may generate a merge candidate list using themotion information of the reconstructed neighboring block and/or themotion information of the collocated block. That is, the encoder and thedecoder may use the motion information of the reconstructed neighboringblock and/or the motion information of the collocated block as mergecandidates for the current block in the case in which the motioninformation of the reconstructed neighboring block and/or the motioninformation of the collocated block are present.

The encoder may select a merge candidate capable of providing optimalencoding efficiency among the merge candidates included in the mergecandidate list as the motion information on the current block. In thiscase, a merge index indicating the selected merge candidate may beincluded in the bit stream and then transmitted to the decoder. Thedecoder may select one of the merge candidates included in the mergecandidate list using the transmitted merge index and determine that theselected merge candidate is the motion information of the current block.Therefore, in the case in which the merge is applied, the motioninformation of the reconstructed neighboring block and/or the motioninformation of the collocated block may be used as the motioninformation of the current block as they are.

In the AVMP and the merge modes described above, the motion informationof the reconstructed neighboring block and/or the motion information ofthe collocated block may be used in order to derive the motioninformation of the current block. Hereinafter, in embodiments to bedescribed below, the motion information derived from the reconstructedneighboring block will be called spatial motion information, and themotion information derived from the collocated block will be calledtemporal motion information. For example, a motion vector derived fromthe reconstructed neighboring block may be called a spatial motionvector, and a motion vector derived from the collocated block may becalled a temporal motion vector.

Again referring to FIG. 3, the encoder and the decoder may performmotion compensation on the current block based on the derived motioninformation to generate a prediction block of the current block (S320).Here, the prediction blocks means a motion compensated block generatedby performing the motion compensation on the current block. In addition,a plurality of motion compensated blocks may configure one motioncompensated picture. Therefore, in embodiments to be described below,the prediction block may be called a ‘motion compensated block’ and/or a‘motion compensated picture’ according to a context. These terms may beeasily distinguished from each other by those skilled in the art.

Meanwhile, as a picture on which the inter prediction is performed,there may be a P picture and a B picture. The P picture means a pictureon which uni-directional prediction may be performed using one referencepicture, and the B picture means a picture on which forward prediction,backward prediction, or bi-directional prediction may be performed usingone or more reference picture, for example, two reference pictures. Forexample, in the B picture, the inter prediction may be performed usingone forward reference picture (a past picture) and one backwardreference picture (a future picture) Further, in the B picture, theprediction may be performed using two forward reference pictures or beperformed using two backward reference pictures.

Here, the reference pictures may be managed by a reference picture list.In the P picture, one reference picture may be used. This referencepicture may be allocated to a reference picture list0 (L0 or List0). Inthe B picture, two reference pictures may be used. These two referencepictures may be allocated to the reference picture list0 and a referencepicture list1 (L1 or Lisa), respectively. Hereinafter, an L0 referencepicture list may have the same meaning as that of the reference picturelist0, and an L1 reference picture list may have the same meaning asthat of the reference picture list1.

Generally, the forward reference picture may be allocated to thereference picture list0, and the backward reference picture may beallocated to the reference picture list1. However, a method ofallocating a reference picture is not limited thereto. That is, theforward reference picture may be allocated to the reference picturelist1, and the backward reference picture may be allocated to thereference picture list0. Hereinafter, the reference picture allocated tothe reference picture list0 will be referred to as an L0 referencepicture, and the reference picture allocated to the reference picturelist1 will be referred to as an L1 reference picture.

The reference pictures may be generally allocated to the referencepicture lists in descending order according to reference picturenumbers. Here, the reference picture numbers mean numbers allocated tothe respective reference pictures in picture order count (POC) order,which means display order and/or time order of the pictures. Forexample, two reference pictures having the same reference picture numbermay correspond to the same reference picture. The reference picturesallocated to the reference picture lists may be reordered by a referencepicture list reordering (RPLR) or memory management control operation(MMCO) command.

As described above, in the P picture, the uni-direction prediction usingone L0 reference picture may be performed, and the B picture, theforward, backward, or bi-directional prediction using one L0 referencepicture and one L1 reference picture, that is, two reference picturesmay be performed. The prediction using one reference picture may becalled uni-prediction, and the prediction using two reference picturesincluding the L0 reference picture and the L1 reference picture may becalled bi-prediction.

Although the bi-directional prediction may be used as a conceptincluding all of the forward prediction, the backward prediction, andthe bi-directional prediction, the prediction using two referencepictures (the L0 reference picture and the L1 reference picture) will becalled the bi-direction prediction in embodiments to be described belowfor convenience. That is, in embodiments to be described below, thebi-direction prediction means the bi-prediction and may be understood asa concept including all of the forward prediction, the backwardprediction, and the bi-direction prediction using two reference pictures(the L0 reference picture and the L1 reference picture). In addition,even in the case in which the bi-direction prediction is performed, theforward prediction or the backward prediction may be performed. However,in embodiments to be described below, the prediction using only onereference picture will be called the uni-directional prediction forconvenience. That is, in embodiments to be described below, theuni-directional prediction means the uni-prediction and may beunderstood as a concept including only the prediction using onereference picture. Further, hereinafter, information indicating whetherthe uni-direction prediction (the uni-prediction) or the bi-directionalprediction (the bi-prediction) is applied to the block on which theprediction is performed is called prediction direction information.

FIG. 4 is a diagram schematically showing an embodiment of an interprediction method in the case in which bi-direction prediction isapplied.

As described above, the encoder and the decoder may perform thebi-directional prediction as well as the uni-directional prediction atthe time of the inter prediction. In the case in which thebi-directional prediction is applied, each of the blocks on which theprediction is performed may have two reference pictures (the L0reference picture and the L1 reference picture). In addition, each ofthe blocks on which the bi-directional prediction is performed may havetwo motion information. Here, the motion information may include areference picture number, a motion vector, and the like.

In the case in which the bi-direction prediction is performed, theencoder and the decoder may select one reference picture in each of thereference picture list0 and the reference picture list1 and use theselected reference pictures for the prediction. That is, two referencepictures including the L0 reference picture and the L1 reference picturemay be used for the bi-direction prediction. Hereinafter, motioninformation corresponding to the L0 reference picture will be called L0motion information, and motion information corresponding to the L1reference picture will be called L1 motion information. In addition,motion compensation using the L0 motion information will be called L0motion compensation, and motion compensation using the L1 motioninformation will be called L1 motion compensation.

Referring to FIG. 4, the encoder and the decoder may perform the L0motion compensation 410 for the current block using the L0 motioninformation and the L0 reference picture list to generate an L0 motioncompensated block. In addition, the encoder and the decoder may performthe L1 motion compensation 420 using the L1 motion information and theL1 reference picture list to generate an L1 motion compensated block.Here, the L0 motion compensation 410 and L1 motion compensation 420processes may be independently performed.

The encoder and the decoder may perform weight averaging 430 of the L0motion compensated block and the L1 motion compensated block to finallygenerate one motion compensated block. As an example, the weightaveraging 430 may be performed in a pixel unit in the L0 motioncompensated block and the L1 motion compensated block. Here, one finallygenerated motion compensated block may correspond to the predictionblock of the current block.

Hereinafter, motion compensation applied at the time of the bi-directionprediction will be called bi-directional motion compensation. Meanwhile,motion compensation applied at the time of the uni-direction predictionwill be called uni-directional motion compensation.

FIG. 5 is a diagram schematically showing an embodiment of motioninformation of an encoded picture. FIG. 5 shows a plurality of blocksconfiguring the encoded picture and motion information of each of theplurality of blocks.

The encoder and the decoder may use a forward B picture in order toimprove inter prediction efficiency in a low delay applicationenvironment. Here, the forward B picture means a B picture on which onlythe forward prediction is performed. In the case in which the forward Bpicture is used, each of the blocks on which the prediction is performedmay have two motion information (the L0 motion information and the L1motion information). In the forward B picture, the L0 reference picturelist and the L1 reference picture may generally be set to be the same aseach other. In the following present specification, in the case in whichthe forward B picture is used, it is assumed that the L0 referencepicture list and the L1 reference picture list are the same as eachother.

The decoder may directly judge whether or not the current picture is theforward B picture based on the L0 reference picture list and the L1reference picture or judge whether or not the current picture is theforward B picture based on the information transmitted from the encoder.For example, the encoder may encode a flag indicating whether or not theL0 reference picture list and the L1 reference picture are the same aseach other and transmit the encoded flag to the decoder. In this case,the decoder may receive and decode the flag and judge whether thecurrent picture is the forward B picture based on the decoded flag. Asanother example, the encoder may transmit an NAL unit type value or aslice type value corresponding to the forward B picture to the decoder,and the decoder may receive the NAL unit type value or the slice typevalue and judge whether or not the current picture is the forward Bpicture based on NAL unit type value or the slice type value.

The picture shown in FIG. 5 is a picture encoded using the forward Bpicture. Therefore, each of the blocks in the encoded block may have atmost two motion information. Here, the motion information may include areference picture number, a motion vector, and the like. Referring toFIG. 5, among the blocks having two motion information, there may aplurality of blocks of which the L0 motion information (for example, thereference picture number and the motion vector) and the L1 motioninformation (for example, the reference picture number and the motionvector) are the same as each other.

In the forward B picture, the blocks of which the L0 motion information(for example, the reference picture number and the motion vector) andthe L1 motion information (for example, the reference picture number andthe motion vector) are the same as each other may be generated due to amethod of deriving temporal motion information. As described above, thetemporal motion information may be derived from the motion informationof the collocated block corresponding to the current block within thepreviously reconstructed collocated picture. For example, at the time ofderiving the L0 temporal motion information of the current block, theencoder and the decoder may use the L0 motion information of thecollocated block corresponding to the current block within thecollocated picture. However, in the case in which the L0 motioninformation is not present in the collocated block, the encoder and thedecoder may use the L1 motion information of the collocated block as theL0 temporal motion information of the current block. On the other hand,at the time of deriving the L1 temporal motion information of thecurrent block, the encoder and the decoder may use the L1 motioninformation of the collocated block corresponding to the current blockwithin the collocated picture. However, in the case in which the L1motion information is not present in the collocated block, the encoderand the decoder may use the L0 motion information of the collocatedblock as the L1 temporal motion information of the current block. As aresult of performing the above-mentioned process, a phenomenon that theL0 motion information and the L1 motion information of the current blockbecome the same as each other may occur. Therefore, in the presentspecification, the case in which the L0 motion information (for example,the reference picture number and the motion vector) and the L1 motioninformation (for example, the reference picture number and the motionvector) are the same as each other and/or the case in which the L0temporal motion information (for example, the reference picture numberand the motion vector) and the L1 temporal motion information (forexample, the reference picture number and the motion vector) are thesame as each other may include the case in which the motion informationof the collocated block corresponding to the current block within thepreviously reconstructed collocated picture has only one of the L0motion information and the L1 motion information.

In addition, in the case in which the block of which the L0 motioninformation and the L1 motion information are the same as each other isgenerated, this block may have an influence on blocks that aresubsequently encoded. For example, in the case in which the merge isapplied, the motion information (the L0 motion information and the L1motion information) of the reconstructed neighboring block and/or thecollocated block may be used as the motion information of the currentblock as it is. Therefore, in the case in which the block of which theL0 motion information and the L1 motion information are the same as eachother is generated, more other blocks of which the L0 motion informationand the L1 motion information are the same as each other may begenerated.

In the case in which the motion compensation is performed on the blockof which the L0 motion information and the L1 motion information are thesame as each other, the same process may be repeatedly performed twiceon one block. This is very inefficient in view of encoding. Therefore,an inter prediction method and/or a motion compensation method capableof reducing computational complexity and improving encoding efficiencyby solving the above-mentioned problem may be provided. As an example,in the case in which the L0 motion information (for example, thereference picture number and the motion vector) and the L1 motioninformation (for example, the reference picture number and the motionvector) are the same as each other, the encoder and the decoder mayperform the motion compensation process only once to reduce thecomputational complexity. As another example, in the case in which theL0 motion information (for example, the reference picture number and themotion vector) and the L1 motion information (for example, the referencepicture number and the motion vector) are the same as each other, theencoder and the decoder may also reset the L0 motion information and/orthe L1 motion information to increase the encoding efficiency.

FIG. 6 is a flow chart schematically showing an embodiment of a methodof deriving temporal motion information of a current block according tothe present invention.

Although embodiments to be described below will be described based onthe temporal motion information, the present invention is not limitedthereto. For example, the method according to the embodiment of FIG. 6may be equally or similarly applied to the motion information of thecurrent block derived based on the merge candidate list in the mergemode and/or the motion information of the current block derived based onthe prediction motion vector candidate list in the AMVP mode as well asthe temporal motion information in the merge mode and/or the AMVP mode.

As described above, the temporal motion information may be derived basedon the motion information of the collocated block corresponding to thecurrent block within the previously reconstructed collocated picture.Here, the collocated picture may correspond to one of reference picturesincluded in a reference picture list as an example. The encoder and thedecoder may determine a predetermined relative position based on theblock present at the spatially same position as that of the currentblock in the collocated picture and derive the collocated block based onthe determined predetermined relative position (for example, thepositions of the inner portion and/or the outer portion of the blockpresent at the spatially same position as that of the current block).The temporal motion information derived based on the collocated blockmay include prediction direction information, an L0 reference picturenumber, an L1 reference picture number, an L0 motion vector, an L1motion vector, and the like.

Referring to FIG. 6, the encoder and the decoder may judge whether ornot the L0 temporal motion information and the L1 temporal motioninformation in the temporal motion information derived based on thecollocated block are the same as each other, that is, whether or not theL0 reference picture number and the L1 reference picture number are thesame as each other and the L0 motion vector and the L1 motion vector arethe same as each other (S610).

In the case in which the L0 temporal motion information and the L1temporal motion information are not the same as each other, that is, inthe case in which the L0 reference picture number and the L1 referencepicture number are not the same as each other and/or the L0 motionvector and the L1 motion vector are not the same as each other, theencoder and the decoder may use the temporal motion information derivedbased on the collocated block as the temporal motion information of thecurrent block as it is. In the case in which the AMVP is applied, thetemporal motion information of the current block may be determined orregistered to be a prediction motion vector candidate for the currentblock. Further, in the case in which the merge is applied, the temporalmotion information of the current block may be determined or registeredto be a merge candidate for the current block.

In the case in which the L0 temporal motion information and the L1temporal motion information are the same as each other, the encoder andthe decoder may judge whether or not the motion information of thereconstructed neighboring block is present (S620). In this case, theencoder and the decoder may judge whether or not the block having themotion information among the reconstructed neighboring blocks positionedat predetermined positions and/or positions selected by a predeterminedmethod is present. Here, the reconstructed neighboring block, which is ablock in a previously encoded and/or decoded and reconstructed currentpicture, may include blocks adjacent to the current block and/or blockspositioned at an outer corner of the current block.

In the case in which the motion information of the reconstructedneighboring block is not present (for example, in the case in which theblock having the motion information among the reconstructed neighboringblocks positioned at the predetermined positions and/or the positionsselected by predetermined method is not present), the encoder and thedecoder may reset the prediction direction information of the currentblock to the uni-directional prediction (S630). Further, in this case,the encoder and the decoder may use only the L0 temporal motioninformation as the temporal motion information of the current block.

In the case in which the motion information of the reconstructedneighboring block is present (for example, in the case in which theblock having the motion information among the reconstructed neighboringblocks positioned at the predetermined positions and/or the positionsselected by the predetermined method is present), the encoder and thedecoder may use the motion information of the reconstructed neighboringblock as the L1 temporal motion information of the current block (S640).That is, in this case, the encoder and the decoder may reset the L1temporal motion information of the current block to the motioninformation of the reconstructed neighboring block. A specificembodiment of the reconstructed neighboring block used to set the L1temporal motion information will be described below.

Although the method of deriving temporal motion information of a currentblock has been described based on a flow chart showing a series of stepsin the above-mentioned embodiment, one or more step in the flow chartmay also be removed. For example, in the above-mentioned embodiment,steps (S620 and S640) may also be omitted. In this case, when the L0temporal motion information and the L1 temporal motion information arethe same as each other, the encoder and the decoder may reset theprediction direction information of the current block to theuni-directional prediction (S630). Further, in this case, the encoderand the decoder may use only the L0 temporal motion information as thetemporal motion information of the current block.

Meanwhile, although whether or not processes of S620 to S640 areperformed is determined based on the sameness of the L0 temporal motioninformation and the L1 temporal motion information in theabove-mentioned embodiment, the encoder and the decoder may alsodetermine whether or not they perform the processes of S620 to S640based on other conditions.

As an embodiment, the encoder and the decoder may determine whether ornot they perform the processes of S620 to S640 based on the sameness ofthe L0 reference picture number and the L1 reference picture number inthe temporal motion information derived based on the collocated block.As an example, the encoder and the decoder may perform the processes ofS620 to S640 in the case in which the L0 reference picture number andthe L1 reference picture number are the same as each other.

As another embodiment, the encoder and the decoder may determine whetheror not they perform the processes of S620 to S640 based on a predictiondirection of the collocated block. As described above, the predictiondirection information means information indicating whether theuni-directional prediction or the bi-directional prediction is appliedto the block on which the prediction block. Therefore, the predictiondirection may correspond to the uni-directional prediction and thebi-directional prediction. As an example, the encoder and the decodermay perform the processes of S620 to S640 in the case in which themotion information (the prediction direction) of the collocated block isthe uni-directional prediction rather than the bi-directionalprediction. The reason is that in the case in which the predictiondirection of the collocated block is the uni-directional prediction, theL0 temporal motion information and the L1 temporal motion information inthe temporal motion information derived based on the collocated blockmay be the same as each other.

As still another embodiment, the encoder and the decoder may determinewhether or not they perform the processes of S620 to S640 based oninformation on whether or not the motion information is present in thecollocated block. As an example, the encoder and the decoder may performthe processes of S620 to S640 in the case in which the motioninformation is not present in the collocated block. In this case, in theabove-mentioned step (S640), the L0 temporal motion information ratherthan the L1 temporal motion information may be reset. That is, theencoder and the decoder may set the L0 temporal motion information tothe motion information of the reconstructed neighboring block andperform the uni-directional prediction rather than the bi-directionalprediction on the current block. In addition, in the case in which themotion information is not present in the collocated block, in theabove-mentioned step (S640), the encoder and the decoder may also resetboth of the L0 temporal motion information and the L1 temporal motioninformation. That is, the encoder and the decoder may set the L0temporal motion information and the L1 temporal motion information tothe motion information of the reconstructed neighboring block and mayalso perform the bi-directional prediction on the current block.

As still another embodiment, the encoder and the decoder may determinewhether or not they perform the processes of S620 to S640 based on asize of the current block. As an example, the encoder and the decodermay judge whether the size of the current block is smaller than apredetermined size. Here, the current block may be the CU, the PU,and/or the TU, and the predetermined size may be one of, for example,8×8, 16×16, 32×32, and the like. Here, the encoder and the decoder mayperform the processes of S620 to S640 in the case in which the size ofthe current block is smaller than the predetermined size.

As still another embodiment, the encoder and the decoder may alsoperform the processes of S620 to S640 in the case in which the L0 motionvector and/or the L1 motion vector in the motion information of thecollocated block correspond to a zero vector (0,0). In this case, in theabove-mentioned step (S640), the encoder and the decoder may reset amotion vector (motion vectors) corresponding to the zero vector (0,0).As an example, the motion vector (motion vectors) corresponding to thezero vector (0,0) may be set to the motion vector of the reconstructedneighboring block. As another example, the motion vector (motionvectors) corresponding to the zero vector (0,0) may also be set to amotion vector of a block positioned around the collocated block. Asstill another embodiment, the encoder and the decoder may also performthe processes of S620 to S640 in the case in which the L0 motion vectorand/or the L1 motion vector in the motion information of the collocatedblock does not correspond to the zero vector (0,0). In this case, in theabove-mentioned step (S640), the encoder and the decoder may reset amotion vector (motion vectors) that does not correspond to the zerovector (0,0). The motion vector (motion vectors) that does notcorrespond to the zero vector (0,0) may be reset to the motion vector ofthe reconstructed neighboring block.

A condition for determining whether or not the processes of S620 to S640are performed is not limited to the above-mentioned embodiments. Thatis, various conditions may be applied according to a condition and/or aneed.

Meanwhile, in the case in which the AMVP is applied, the encoder and/orthe decoder may use a candidate having the smallest difference from themotion vector of the current block among the prediction motion vectorcandidates in the prediction motion vector candidate list as theprediction motion vector of the current block, and in the case in whichthe merge is applied, the encoder and/or the decoder may use a mergecandidate capable of providing optimal encoding efficiency among themerge candidates in the merge candidate list as the predictioninformation on the current block. Since each of the prediction motionvector candidate list and the merge candidate list may include thetemporal motion information and/or the spatial motion information, themotion information (for example, the reference picture number, themotion information, or the like) of the current block may be derivedbased on the motion information of the reconstructed neighboring block.Therefore, in the above-mentioned step (S640) of resetting L1 temporalmotion information, the encoder and the decoder may reset the L1temporal motion information based on the prediction motion vectorcandidate list of the current block and/or the merge candidate list ofthe current block. In this case, the above-mentioned step (S630) ofjudging whether or not a reconstructed neighboring block is presentedmay be omitted. Hereinafter, in embodiments to be described below, themotion information candidate list may be understood as a conceptincluding the prediction motion vector candidate list and the mergecandidate list.

As described above, the encoder and the decoder may reset the L1temporal motion information of the current block based on the motioninformation candidate list of the current block. That is, the encoderand the decoder may use one of the motion information candidatesincluded in the motion information candidate list of the current blockas the L1 temporal motion information. The motion information in themotion information candidate list of the current block used as the L1temporal motion information may be determined by various methods.

As an embodiment, the encoder and the decoder may search the motioninformation candidates in the motion information candidate list in orderfrom a first motion information candidate up to a final motioninformation candidate. In this case, the encoder and the decoder may usea first motion information candidate having the same reference picturenumber as the L1 reference picture number of the L1 temporal motioninformation derived based on the collocated block as the L1 temporalmotion information of the current block. In this case, the encoder andthe decoder may use the L0 motion information of the first motioninformation candidate having the same reference picture number as the L1reference picture number or use the L1 motion information of the firstmotion information candidate having the same reference picture number asthe L1 reference picture number. Meanwhile, the motion informationhaving the same reference picture number as the L1 reference picturenumber of the L1 temporal motion information derived based on thecollocated block may not be present in the motion information candidatelist. In this case, the encoder and the decoder may also add the motioninformation having the same reference picture number as the L1 referencepicture number among the motion information of the reconstructedneighboring block to the motion information candidate list. In thiscase, the encoder and the decoder may reset the L1 temporal motioninformation of the current block based on the motion informationcandidate list to which the motion information of the reconstructedneighboring information is added.

As another embodiment, the encoder and the decoder may use a motionvector of a first motion information candidate having an availablemotion vector in the motion information candidate list as the L1temporal motion information of the current block. In this case, theencoder and the decoder may use the L0 motion information of the firstmotion information candidate or use the L1 motion information of thefirst motion information candidate.

As still another embodiment, the encoder and the decoder may use a firstavailable motion information candidate in the motion informationcandidate list as the L1 temporal motion information of the currentblock. In this case, the L1 reference picture number of the L1 temporalmotion information may be changed or set to the reference picture numberof the first motion information candidate, and the L1 motion vector ofthe L1 temporal motion information may be changed or set to the motionvector of the first motion information candidate. In this case, theencoder and the decoder may use the L0 motion information of the firstmotion information candidate or use the L1 motion information of thefirst motion information candidate.

The method of determining the motion information candidate used as theL1 temporal motion information in the motion information candidate listof the current block is not limited to the above-mentioned embodiments.That is, various conditions may be applied according to a conditionand/or a need.

In the above-mentioned embodiments, available motion information may notbe present in the motion information candidate list of the currentblock. In this case, as an example, the encoder and the decoder may usethe motion information of the reconstructed neighboring block as the L1temporal motion information of the current block as in theabove-mentioned step (S640). As another example, in this case, theencoder and the decoder may also add the motion information of thereconstructed neighboring block to the motion information candidate listor add the zero vector (0,0) to the motion information candidate list.In this case, the encoder and the decoder may reset the L1 temporalmotion information of the current block based on the motion informationcandidate list to which the motion information of the reconstructedneighboring information is added or the motion information candidatelist to which the zero vector (0,0) is added.

In the above-mentioned embodiments, since the L0 temporal motioninformation and the L1 temporal motion information are the temporallyderived motion information, it is likely that they will correspond tomotion information by movement of an object. Therefore, the encoder andthe decoder may select the motion information that does not have thezero vector (0,0) rather than the motion information that has the zerovector (0,0) when they search the motion information to be used as theL1 temporal motion information of the current block in the reconstructedneighboring block and/or the motion information candidate list. Thereason is that it is likely that the block having the motion informationcorresponding to the zero vector (0,0) will correspond to a backgroundrather than the object.

Meanwhile, the reset L1 temporal motion information may also be the sameas the L0 temporal motion information of the current block. Therefore,the encoder and the decoder may select the motion information that isnot the same as the L0 temporal motion information when they search themotion information to be used as the L1 temporal motion information ofthe current block in the reconstructed neighboring block and/or themotion information candidate list. For example, as in theabove-mentioned S640, in the case in which the L1 temporal motioninformation of the current block is derived based on the reconstructedneighboring block, the encoder and the decoder may determine that ablock having motion information different from the L0 temporal motioninformation of the current block is a block used to derive the L1temporal motion information. In this case, the encoder and the decodermay also select only motion information having a difference of apredetermined threshold or less from the L0 temporal motion informationof the current block as the motion information to be used as the L1temporal motion information of the current block. Here, thepredetermined threshold may be determined based on the mode informationof the current block, the motion information of the current block, themode information of the neighboring block, the motion information of theneighboring block, and the like, and be determined in various schemes.

In addition, in the above-mentioned embodiments, each of the motioninformation of the reconstructed neighboring block and the motioninformation selected from the motion information candidate list mayinclude both of the L0 motion information and the L1 motion information.In this case, the encoder and the decoder may determine that one of theL0 motion information and the L1 motion information is the motioninformation to be used as the L1 temporal motion information of thecurrent block. As an example, the encoder and the decoder may use the L0motion information in the motion information of the reconstructedneighboring block and/or the motion information selected from the motioninformation candidate list as the L1 temporal motion information of thecurrent block. In this case, when the L0 motion information is notpresent in the motion information of the reconstructed neighboring blockand the motion information selected from the motion informationcandidate list, the encoder and the decoder may use the L1 motioninformation as the L1 temporal motion information of the current block.As another example, the encoder and the decoder may use the L1 motioninformation in the motion information of the reconstructed neighboringblock and the motion information selected from the motion informationcandidate list as the L1 temporal motion information of the currentblock. In this case, when the L1 motion information is not present inthe motion information of the reconstructed neighboring block and themotion information selected from the motion information candidate list,the encoder and the decoder may use the L0 motion information as the L1temporal motion information of the current block.

Meanwhile, the encoder and the decoder may not use the motioninformation of the reconstructed neighboring block and/or the motioninformation candidate list in order to reset the L1 temporal motioninformation (for example, the L1 motion vector) of the current block inthe above-mentioned step (S640). In this case, the encoder and thedecoder may reset the L1 temporal motion information (for example, theL1 motion vector) of the current block based on the L0 temporal motioninformation (for example, the L0 motion vector) of the current block.Hereinafter, embodiments related to this will be described based on amotion vector.

As an embodiment, the encoder and the decoder may use motion informationindicating a relative position moved from a position indicated by the L0temporal motion information (the L0 motion vector) of the current blockbased on a predetermined distance and/or direction as the L1 temporalmotion information (the L1 motion vector) of the current block. As anexample, the encoder and the decoder may use motion informationindicating a position moved from a position indicated by the L0 temporalmotion information of the current block in a vertical and/or horizontaldirection by a ¼ pixel size (for example, (−1,0), (1,0), (0,−1), (0,1),(−1,−1), (−1,1), (1,−1), (1,1), or the like. Here, a ¼ pixel unitcorresponds to 1) as the L1 temporal motion information of the currentblock. As another example, the encoder and the decoder may use motioninformation indicating a position moved from a position indicated by theL0 temporal motion information of the current block in the verticaland/or horizontal direction by a ½ pixel size (for example, (−2,0),(2,0), (0,−2), (0,2), (−2,−2), (−2,2), (2,−2), (2,2), or the like. Here,a ¼ pixel unit corresponds to 1) as the L1 temporal motion informationof the current block. As still another example, the encoder and thedecoder may use motion information indicating a position moved from aposition indicated by the L0 temporal motion information of the currentblock in the vertical and/or horizontal direction by an integer pixelsize (for example, (−4,0), (4,0), (0,−4), (0,4), (−4,−4), (−4,4),(4,−4), (4,4), or the like. Here, a ¼ pixel unit corresponds to 1) asthe L1 temporal motion information of the current block.

Meanwhile, since the motion vector includes a vertical directioncomponent and a horizontal direction component, the above-mentionedmethods (the movement by the ¼ pixel size, the movement by the ½ pixelsize, the movement by the integer pixel size) may also be independentlyapplied to each of the horizontal direction component and the verticaldirection component. In this case, a movement distance in the horizontaldirection and a movement distance in the vertical direction may also bedifferent from each other.

As another embodiment, the encoder and the decoder may change the L0temporal motion information (the L0 motion vector) value of the currentblock into a value of other pixel unit and then use the changed value asthe L1 temporal motion information (the L1 motion vector) of the currentblock. As an example, in the case in which the L0 temporal motioninformation value of the current block is a value of the ¼ pixel unit,the encoder and the decoder may change the L0 temporal motioninformation value into a value of a ½ pixel unit based on a shiftoperation, or the like, and use the changed value as the L1 temporalmotion information of the current block. As another example, in the casein which the L0 temporal motion information value of the current blockis a value of a ½ pixel unit, the encoder and the decoder may change theL0 temporal motion information value into a value of an integer pixelunit based on the shift operation, or the like, and uses the changedvalue as the L1 temporal motion information of the current block.

The method of resetting the L1 temporal motion information (for example,the L1 motion vector) of the current block based on the L0 temporalmotion information (for example, the L0 motion vector) of the currentblock is not limited to the above-mentioned embodiments, but may bevariously applied in various forms according to an implementation and/ora need.

Meanwhile, in the above-mentioned embodiment, the temporal motioninformation input to step (S610) before resetting the temporal motioninformation may include a reference picture index as well as a motionvector. Here, the L0 motion vector and the L1 motion vector may be amotion vector temporally derived based on the collocated block asdescribed above, and the L0 reference picture index and the L1 referencepicture index may be a reference picture index spatially derived fromthe reconstructed neighboring block. Here, the L0 reference pictureindex and the L1 reference picture index may be set to the non-negativesmallest value among the reference picture indices of the reconstructedneighboring block. Meanwhile, as another example, an L0 input referencepicture index and an L1 input reference picture index may also be set to0 regardless of the motion information of the reconstructed neighboringblock.

In the case in which the L1 motion vector of the L1 temporal motioninformation is reset based on the reconstructed neighboring block, aresetting process may also be performed on the L1 reference pictureindex of the L1 temporal motion information.

Hereinafter, in embodiments of FIGS. 6 to 8 to be described below, forconvenience of explanation, the temporal motion information input tostep (S610) before resetting the temporal motion information will becalled input temporal motion information (L0 input temporal motioninformation and L1 input temporal motion information). In addition, amotion vector included in the input temporal motion information will becalled an input motion vector (an L0 input motion vector and an L1 inputmotion vector), a reference picture index included in the input temporalmotion information will be called an input reference picture index (anL0 input reference picture index and an L1 input reference pictureindex), and a reference picture number included in the input temporalmotion information will be called an input reference picture number (anL0 input reference picture number and an L1 input reference picturenumber).

As described above, in the case in which the L1 input motion vector isreset, the encoder and the decoder may also perform a resetting processon the L1 input reference picture index. Hereinafter, embodiments of aprocess of resetting the L1 input reference picture index will bedescribed.

As an example, the encoder and the decoder may reset the L1 inputreference picture index based on the reconstructed neighboring block. Asdescribed above, the encoder and the decoder may use the motioninformation of the reconstructed neighboring block as the L1 temporalmotion information of the current block. In this case, the encoder andthe decoder may reset the L1 input reference picture index to thereference picture index of the reconstructed neighboring block to derivea final L1 reference picture index. As another embodiment, the encoderand the decoder may reset the L1 input reference picture index value toa predetermined fixed reference picture index value to derive a final L1reference picture index.

As still another embodiment, in the case in which the L0 input temporalmotion information (for example, the L0 input motion vector, the L0input reference picture index, and the like) and L1 input temporalmotion information (for example, the L1 input motion vector, the L1input reference picture index, and the like) are the same as each other,the encoder and the decoder may reset both of the L0 input referencepicture index and the L1 input reference picture index to a value of 0to use the reset value as final temporal motion information. The reasonis that in the case in which the L0 input temporal motion informationand the L1 input temporal motion information are the same as each other,it is likely that both of the L0 reference picture index and the L1reference picture index will be 0.

As still another embodiment, the encoder and the decoder may reset theL1 input reference picture index to the same value as that of the L0input reference picture index. On the other hand, the encoder and thedecoder may also reset the L1 input reference picture index value to thereference picture index value that is not the same as that of the L0input reference picture index. As an example, reference picture indicesthat are not the same as the L0 input reference picture index among thereference picture indices of the reconstructed neighboring blocks may bepresent. In this case, for example, the encoder and the decoder may usethe most frequently used reference picture index among the referencepicture indices that are not the same as the L0 input reference pictureindex in order to reset the L1 input reference picture index. As anotherexample, the encoder and the decoder may also use the reference pictureindex having the non-negative smallest value among the reference pictureindices that are not the same as the L0 input reference picture index inorder to reset the L1 input reference picture index.

Meanwhile, as described above, the encoder and the decoder may reset theL1 input motion vector value in the L1 input temporal motion informationto the same value as that of the motion vector of the reconstructedneighboring block to derive a final L1 temporal motion vector. In thiscase, the motion vector of the reconstructed neighboring block may alsobe scaled and used according to the L1 input reference picture indexand/or the reset L1 reference picture index. The L1 input referencepicture index in the L1 input temporal motion information may be used asthe final L1 temporal motion information as it is without beingsubjected to the resetting process or be subjected to the resettingprocesses and then used as the final L1 temporal motion information asin the above-mentioned embodiment. Here, a reference picturecorresponding to the motion vector of the reconstructed neighboringblock and a reference picture indicated by the final L1 referencepicture index may be different from each other. In this case, theencoder and the decoder may perform scaling on the motion vector of thereconstructed neighboring block and use the scaled motion vector as thefinal L1 temporal motion information of the current block.

The above-mentioned embodiments may be combined with each other byvarious methods according to the process of resetting the motion vectorand the process of resetting the reference picture index (for example,RefIdxLX, X=0,1). Hereinafter, in embodiments to be described below, itis assumed that the L1 input motion vector is reset based on thereconstructed neighboring block. That is, it is assumed that the encoderand the decoder reset the L1 input motion vector to one of the motionvectors of the reconstructed neighboring blocks.

As an embodiment, the encoder and the decoder may use only the motionvector rather than the zero vector among the motion vectors of thereconstructed neighboring blocks in order to reset the L1 input motionvector. In this case, as an example, the L1 input reference pictureindex may be used as the final L1 temporal motion information as it iswithout being subjected to the resetting process. As another example,the L1 input reference picture index value may be reset to the referencepicture index value of the reconstructed neighboring block, and thereset reference picture index may be used as the final L1 temporalmotion information. As another example, the L1 input reference pictureindex value may also be reset to a predetermined fixed reference pictureindex value. Since specific embodiments of each of them have beendescribed above, a description thereof will be omitted.

As another embodiment, the encoder and the decoder may scale and use themotion vector of the reconstructed neighboring block in order to resetthe L1 input motion vector. In this case, the scaled motion vector maybe used as the final L1 temporal motion information. In this case, as anexample, the L1 input reference picture index may be used as the finalL1 temporal motion information as it is without being subjected to theresetting process. As another example, the L1 input reference pictureindex value may be reset to the reference picture index value of thereconstructed neighboring block, and the reset reference picture indexmay be used as the final L1 temporal motion information. As anotherexample, the L1 input reference picture index value may also be reset toa predetermined fixed reference picture index value. Since specificembodiments of each of them have been described above, a descriptionthereof will be omitted.

As still another embodiment, the encoder and the decoder may use onlythe motion vector having a difference of a predetermined threshold orless from the L0 temporal motion information (the L0 motion vector) ofthe current block among the motion vectors of the reconstructedneighboring blocks in order to reset the L1 input motion vector. In thiscase, the encoder and the decoder may also use only the motion vectorthat is not the same as the L0 temporal motion information (the L0motion vector) of the current block among the motion vectors of thereconstructed neighboring blocks. In this case, as an example, the L1input reference picture index may be used as the final L1 temporalmotion information as it is without being subjected to the resettingprocess. As another example, the L1 input reference picture index valuemay be reset to the reference picture index value of the reconstructedneighboring block, and the reset reference picture index may be used asthe final L1 temporal motion information. As another example, the L1input reference picture index value may also be reset to a predeterminedfixed reference picture index value. Since specific embodiments of eachof them have been described above, a description thereof will beomitted.

A combination of the embodiments of the process of resetting the motionvector and the process of resetting the reference picture index is notlimited to the above-mentioned embodiment, but may be provided invarious forms according to an implementation and/or a need.

Meanwhile, as described above, the reset L1 temporal motion informationmay be the same as the L0 temporal motion information of the currentblock. Therefore, when the reset L1 temporal motion information is thesame as the L0 temporal motion information of the current block, theencoder and the decoder may reset the prediction direction informationof the current block to the uni-directional prediction. In this case,the encoder and the decoder may use only the L0 temporal motioninformation as the temporal motion information of the current block.This method, which is a combination with the above-mentionedembodiments, may be applied to the present invention.

FIG. 7 is a diagram schematically showing an embodiment of reconstructedneighboring blocks used to reset L1 temporal motion information. In FIG.7, a block 710 indicates a current block X.

As described above, the reconstructed neighboring block, which is ablock in a previously encoded and/or decoded and reconstructed currentpicture, may include blocks adjacent to the current block 710 and/orblocks positioned at an outer corner of the current block 710. In theembodiment of FIG. 7, a block positioned at a left lower corner of anouter portion of the current block 710 is called a left lower cornerblock A, a block positioned at a left upper corner of the outer portionof the current block 710 is called a left upper corner block E, and ablock positioned at a right upper corner of the outer portion of thecurrent block 710 is called a right upper corner block C. In addition, ablock positioned at the uppermost portion among blocks adjacent to theleft of the current block 710 is called a left uppermost block F, ablock positioned at the lowermost portion among the blocks adjacent tothe left of the current block 710 is called a left lowermost block A, ablock positioned at the leftmost portion among blocks adjacent to anupper portion of the current block 710 is called an upper leftmost blockG, and a block positioned at the rightmost portion among the blocksadjacent to the upper portion of the current block 710 is called anupper rightmost block B.

As described above in the embodiment of FIG. 6, the encoder and thedecoder may use the motion information of the reconstructed neighboringblock as the L1 temporal motion information of the current blockaccording to a predetermined condition. That is, the encoder and thedecoder may reset the L1 temporal motion information value of thecurrent block to the motion information value of the reconstructedneighboring block. Here, the motion information used as the L1 temporalmotion information of the current block may be derived by variousmethods.

As an embodiment, the encoder and the decoder may derive the motioninformation used as the L1 temporal motion information from one blockpresent at a predetermined position among the reconstructed neighboringblocks. In this case, the block present at the predetermined positionmay correspond to one of the left lowermost block A, the upper rightmostblock B, the right upper corner block C, the left lower corner block D,the left upper corner block E, the left uppermost block F, and the upperleftmost block G.

As another embodiment, the encoder and the decoder may scan a pluralityof blocks present at the predetermined positions among the reconstructedneighboring blocks in a predetermined order. In this case, the encoderand the decoder may use motion information of a first block in which themotion information is present in scan order as the L1 temporal motioninformation of the current block. A scan target block and a scan ordermay be determined in various forms. As an example, the encoder and thedecoder may scan the neighboring blocks in order of the left uppermostblock F, the upper leftmost block G, and the upper rightmost block B. Asanother example, the encoder and the decoder may also scan theneighboring blocks in order of the left uppermost block F, the upperleftmost block G, the right upper corner block C, the left lower cornerblock D, and the left upper corner block E. As still another example,the encoder and the decoder may scan the neighboring blocks in order ofthe left lowermost block A, the upper rightmost block B, and the leftupper corner block E. As still another example, the encoder and thedecoder may also scan the neighboring blocks in order of the leftlowermost block A, the upper rightmost block B, the right upper cornerblock C, the left lower corner block D, and the left upper corner blockE. As still another example, the encoder and the decoder may also scanthe neighboring blocks in order of the left lowermost block A, the upperrightmost block B, the right upper corner block C, the left lower cornerblock D, the left upper corner block E, the left uppermost block F, andthe upper leftmost block G.

As still another embodiment, the encoder and the decoder may derive anintermediate value of the motion information of the plurality of blockspresent at the predetermined positions among the reconstructedneighboring blocks and use the derived intermediate value as the L1temporal motion information of the current block. For example, theplurality of blocks may be the left uppermost block F, the upperleftmost block G, the right upper corner block C, the left lower cornerblock D, and the left upper corner block E.

The method of deriving the L1 temporal motion information of the currentblock from the reconstructed neighboring block is not limited thereto.That is, the L1 temporal motion information of the current block may bederived by various methods according to an implementation and/or a need.

Hereinafter, an embodiment of a process of deriving temporal motioninformation according to the embodiments of FIGS. 6 and 7 will bedescribed in view of the decoder. An inputs for the process of derivingtemporal motion information may include a position (xP, yP) of theleftmost upper sample of the current block, an input motion vectormvLXCol), an input reference picture number (RefPicOrder(currPic,refIdxLX, LX)), and the like. Here, currPic means the current picture.An outpour of the process may be a motion vector (mvLXCol) used as thefinal temporal motion information and information (availableFlagLXCol)indicating whether or not the final temporal motion information ispresent. Here, X may have a value of 0 or 1. For example, in the case inwhich X is 0, mvLXCol, refIdxLX, and LX may be mvL0Col, refIdxL0, andL0, respectively, which mean variables associated with the L0 temporalmotion information. In addition, mvLX means a motion vector, mvLX[0]means an x component motion vector, and mvLX[1] means a y componentmotion vector. refIdxLX means an LX reference picture index indicating areference picture in an LX reference picture list in which referencepictures are stored. In the case in which a value of refIdxLX is 0,refIdxLX may indicate a first reference picture in the LX referencepicture list, and the case in which a value of refIdxLX is −1, refIdxLXmay indicate that a reference picture is not present in the referencepicture list. In addition, predFlagLX to be described below may indicatewhether or not motion compensation is performed at the time ofgeneration of a prediction block. For example, in the case in which avalue of predFlagLX is 1, the encoder and the decoder may perform themotion compensation at the time of the generation of the predictionblock.

When the input motion vector mvL0Col and mvL1Col are the same as eachother and RefPicOrder (currPic, refIdxL0, L0) and RefPicOrder (currPic,refIdxL1, L1) are the same as each other (that is, when the L0 referencepicture number and the L1 reference picture number are the same as eachother), the encoder and the decoder may perform the following process.

When the left uppermost block A (xP−1, yP) adjacent to the left of thecurrent block is present and is not a block encoded in the intra mode,predFlagL0A is ‘1’, and mvL0A is not (0,0), the encoder and the decodermay perform the following process. Here, A may indicate that predFlagL0Aand mvL0A are information on the left uppermost block A.

mvL1Col=mvL1L0A

On the other hand, when the upper leftmost block B (xP, yP−1) adjacentto the upper portion of the current block is present and is not theblock encoded in the intra mode, predFlagL0B is ‘1’, and mvL0B is not(0,0), the encoder and the decoder may perform the following process.Here, B may indicate that predFlagL0B and mvL0B are information on theupper leftmost block B.

mvL1Col=mvL0B

On the other hand, when the left upper corner block E (xP−1, yP−1)positioned at the left upper corner of the outer portion of the currentblock is present and is not the block encoded in the intra mode,predFlagL0E is ‘1’, and mvL0E is not (0,0), the encoder and the decodermay perform the following process. Here, E may indicate that predFlagL0Eand mvL0E are information on the left upper corner block E.

mvL1Col=mvL0E

Here, when mvL0Col and mvL1Col are the same as each other, the encoderand the decoder may perform the following process.

avilableFlagL1Col=0

In addition, the encoder and the decoder may perform the followingprocess.

availableFlagCol=availableFlagL0Col∥availableFlagL1Col

predFlagLXCol=availableFlagLXCol

Here, availableFlagCol may indicate whether or not the temporal motioninformation is derived, predFlagLXCol may indicate whether or not thefinal temporal motion information is present for each of the L0 temporalmotion information and the L1 temporal motion information.

FIG. 8 is a block diagram schematically showing an embodiment of aninter prediction apparatus capable of performing the process of derivingtemporal motion information according to the embodiment of FIG. 6. Theinter prediction apparatus according to the embodiment of FIG. 8 mayinclude a temporal motion information judging unit 810, a reconstructedneighboring block motion information judging unit 820, a predictiondirection information resetting and L0 motion information setting unit830, and an L1 temporal motion information resetting unit 840.

Referring to FIG. 8, the temporal motion information judging unit 810may judge whether or not the L0 temporal motion information and the L1temporal motion information in the input temporal motion information arethe same as each other, that is, whether or not the L0 reference picturenumber and the L1 reference picture number are the same as each otherand the L0 motion vector and the L1 motion vector are the same as eachother.

In the case in which the L0 temporal motion information and the L1temporal motion information are not the same as each other, the interprediction apparatus may use the input temporal motion information asthe temporal motion information of the current block as it is. In thecase in which the AMVP is applied, the temporal motion information ofthe current block may be determined or registered to be a predictionmotion vector candidate for the current block. Further, in the case inwhich the merge is applied, the temporal motion information of thecurrent block may be determined or registered to be a merge candidatefor the current block. In the case in which the L0 temporal motioninformation and the L1 temporal motion information are the same as eachother, a judging process by the reconstructed neighboring block motioninformation judging unit 820 may be performed.

Meanwhile, as described above with reference to FIG. 6, the temporalmotion information judging unit 810 may also judge whether or not the L0reference picture number and the L1 reference picture number are thesame as each other rather than whether or not the L0 temporal motioninformation and the L1 temporal motion information are the same as eachother or a prediction direction of the collocated block. For example, inthe case in which the L0 reference picture number and the L1 referencepicture number are not the same as each other, the inter predictionapparatus may use the input temporal motion information as the temporalmotion information of the current block as it is, and in the case inwhich the L0 reference picture number and the L1 reference picturenumber are the same as each other, the judging process by thereconstructed neighboring block motion information judging unit 820 maybe performed. As another example, in the case in which the predictiondirection of the collocated block is the bi-directional prediction, theinter prediction apparatus may use the input temporal motion informationas the temporal motion information of the current block as it is, and inthe case in which the prediction direction of the collocated block isthe uni-directional prediction, the judging process by the reconstructedneighboring block motion information judging unit 820 may be performed.

The reconstructed neighboring block motion information judging unit 820may judge whether or not the motion information of the reconstructedneighboring block is present. In the case in which the motioninformation of the reconstructed neighboring block is not present (forexample, in the case in which the block having the motion informationamong the reconstructed neighboring blocks positioned at predeterminedpositions and/or positions selected by a predetermined method is notpresent), a prediction direction information resetting and L0 motioninformation setting process by the prediction direction informationresetting and L0 motion information setting unit 830 may be performed.Further, in the case in which the motion information of thereconstructed neighboring block is present (for example, in the case inwhich the block having the motion information among the reconstructedneighboring blocks positioned at the predetermined positions and/or thepositions selected by the predetermined method is present), a resettingprocess may by the L1 temporal motion information resetting unit 840 beperformed.

In the case in which the motion information of the reconstructedneighboring block is not present, the prediction direction informationresetting and L0 motion information setting unit 830 may reset theprediction direction information of the current block to theunit-directional perdition. In addition, in this case, the predictiondirection information resetting and L0 motion information setting unit830 may set only the L0 temporal motion information among the inputtemporal motion information to the final temporal motion information ofthe current block.

In the case in which the motion information of the reconstructedneighboring block is present, the L1 temporal motion informationresetting unit 840 may reset the L1 temporal motion information of thecurrent block to the motion information of the reconstructed neighboringblock. That is, the inter prediction apparatus may use the motioninformation of the reconstructed neighboring block as the L1 temporalmotion information of the current block. In this case, as an example,the L1 temporal motion information resetting unit 840 may select onlythe motion information that does not have the zero vector (0,0) ratherthan the motion information that has the zero vector (0,0) when itsearches the motion information to be used as the L1 temporal motioninformation of the current block in the reconstructed neighboring block.Meanwhile, the L1 temporal motion information resetting unit 840 mayalso reset the L1 temporal motion information of the current block basedon the motion information candidate list of the current block. Sincespecific embodiments of each of the above-mentioned methods have beendescribed with reference to FIGS. 6 and 7, a description thereof will beomitted.

FIG. 9 is a flow chart schematically showing another embodiment of amethod of deriving temporal motion information of a current blockaccording to the present invention.

Although embodiments to be described below will be described based onthe temporal motion information, the present invention is not limitedthereto. For example, the method according to the embodiment of FIG. 9may be equally or similarly applied to the motion information of thecurrent block derived based on the merge candidate list in the mergemode and/or the motion information of the current block derived based onthe prediction motion vector candidate list in the AMVP mode as well asthe temporal motion information in the merge mode and/or the AMVP mode.

As described above, the temporal motion information may be derived basedon the motion information of the collocated block corresponding to thecurrent block within the previously reconstructed collocated picture.Here, the collocated picture may correspond to one of reference picturesincluded in a reference picture list as an example. The encoder and thedecoder may determine a predetermined relative position based on theblock present at the spatially same position as that of the currentblock in the collocated picture and derive the collocated block based onthe determined predetermined relative position (for example, thepositions of the inner portion and/or the outer portion of the blockpresent at the spatially same position as that of the current block).The temporal motion information derived based on the collocated blockmay include prediction direction information, an L0 reference picturenumber, an L1 reference picture number, an L0 motion vector, an L1motion vector, and the like.

Referring to FIG. 9, the encoder and the decoder may judge whether ornot the L0 temporal motion information and the L1 temporal motioninformation in the temporal motion information derived based on thecollocated block are the same as each other, that is, whether or not theL0 reference picture number and the L1 reference picture number are thesame as each other and the L0 motion vector and the L1 motion vector arethe same as each other (S910). Hereinafter, in embodiments of FIGS. 9 to11 to be described below, for convenience of explanation, the temporalmotion information input to step (S910) before resetting the temporalmotion information will be called input temporal motion information (L0input temporal motion information and L1 input temporal motioninformation). In addition, a motion vector included in the inputtemporal motion information will be called an input motion vector (an L0input motion vector and an L1 input motion vector), a reference pictureindex included in the input temporal motion information will be calledan input reference picture index (an L0 input reference picture indexand an L1 input reference picture index), and a reference picture numberincluded in the input temporal motion information will be called aninput reference picture number (an L0 input reference picture number andan L1 input reference picture number).

In the case in which the L0 input temporal motion information and the L1input temporal motion information are not the same as each other, thatis, in the case in which the L0 input reference picture number and theL1 input reference picture number are not the same as each other and/orthe L0 input motion vector and the L1 input motion vector are not thesame as each other, the encoder and the decoder may use the inputtemporal motion information derived based on the collocated block as thetemporal motion information of the current block as it is. In the casein which the AMVP is applied, the temporal motion information of thecurrent block may be determined or registered to be a prediction motionvector candidate for the current block. Further, in the case in whichthe merge is applied, the temporal motion information of the currentblock may be determined or registered to be a merge candidate for thecurrent block.

In the case in which the L0 input temporal motion information and the L1input temporal motion information are the same as each other, theencoder and the decoder may judge whether or not the motion informationof the collocated block is present (S920). Here, the collocated blockmay be a newly derived collocated block rather than the collocated blockused to derive the input temporal motion information. For example, theencoder and the decoder may judge whether or not the block having themotion information among the collocated blocks positioned atpredetermined positions and/or positions selected by a predeterminedmethod is present.

Hereinafter, in embodiments of FIGS. 9 to 11, for convenience ofexplanation, a collocated block used to derive the input temporal motioninformation will be called a first collocated block, and a collocatedblock used to reset the L1 input temporal motion information as shown instep (S940) while being a judgment target regarding whether or notmotion information is present as shown in step (S920) will be called asecond collocated block. A collocated picture including the firstcollocated block will be called a first collocated picture, and acollocated picture including the second collocated block will be calleda second collocated picture. Here, as an example, each of the first andsecond collocated pictures may correspond to one of the referencepictures included in the reference picture list.

In the case in which the motion information of the second collocatedblock is not present (for example, in the case in which the block havingthe motion information among the second collocated blocks positioned atthe predetermined positions and/or the positions selected by thepredetermined method is not present), the encoder and the decoder mayreset the prediction direction information of the current block to theuni-directional prediction (S930). Further, in this case, the encoderand the decoder may use only the L0 input temporal motion information asthe temporal motion information of the current block.

In the case in which the motion information of the second collocatedblock is present (for example, in the case in which the block having themotion information among the second collocated blocks positioned at thepredetermined positions and/or the positions selected by thepredetermined method is present), the encoder and the decoder may usethe motion information of the second collocated block as the final L1temporal motion information of the current block (S940). That is, inthis case, the encoder and the decoder may reset the L1 input temporalmotion information of the current block to the motion information of thesecond collocated block. Specific embodiments of the second collocatedpicture and the second collocated block used to reset the L1 inputtemporal motion information will be described below.

Although the method of deriving temporal motion information of a currentblock has been described based on a flow chart showing a series of stepsin the above-mentioned embodiment, one or more step in the flow chartmay also be removed. For example, in the above-mentioned embodiment,steps (S920 and S940) may also be omitted. In this case, when the L0input temporal motion information and the L1 input temporal motioninformation are the same as each other, the encoder and the decoder mayreset the prediction direction information of the current block to theuni-directional prediction (S930). Further, in this case, the encoderand the decoder may use only the L0 input temporal motion information asthe final temporal motion information of the current block.

Meanwhile, although whether or not processes of S920 to S940 areperformed is determined based on the sameness of the L0 input temporalmotion information and the L1 input temporal motion information in theabove-mentioned embodiment, the encoder and the decoder may alsodetermine whether or not they perform the processes of S920 to S940based on other conditions.

As an embodiment, the encoder and the decoder may determine whether theyperform the processes of S920 to S940 based on the sameness of the L0input reference picture number and the L1 input reference picturenumber. As an example, the encoder and the decoder may perform theprocesses of S920 to S940 in the case in which the L0 input referencepicture number and the L1 input reference picture number are the same aseach other.

As another embodiment, the encoder and the decoder may determine whetheror not they perform the processes of S920 to S940 based on a predictiondirection of the first collocated block. As described above, theprediction direction information means information indicating whetherthe uni-directional prediction or the bi-directional prediction isapplied to the block on which the prediction block. Therefore, theprediction direction may correspond to the uni-directional predictionand the bi-directional prediction. As an example, the encoder and thedecoder may perform the processes of S920 to S940 in the case in whichthe motion information (the prediction direction) of the firstcollocated block is the uni-directional prediction rather than thebi-directional prediction. The reason is that in the case in which theprediction direction of the first collocated block is theuni-directional prediction, the L0 input temporal motion information andthe L1 input temporal motion information in the input temporal motioninformation derived from the collocated block may be the same as eachother.

As still another embodiment, the encoder and the decoder may determinewhether or not they perform the processes of S920 to S940 based oninformation on whether or not the motion information is present in thefirst collocated block. As an example, the encoder and the decoder mayperform the processes of S920 to S940 in the case in which the motioninformation is not present in the first collocated block. In this case,in the above-mentioned step (S940), the L0 input temporal motioninformation rather than the L1 input temporal motion information may bereset. That is, the encoder and the decoder may set the L0 inputtemporal motion information to the motion information of the secondcollocated block and perform the uni-directional prediction rather thanthe bi-directional prediction on the current block. In addition, in thecase in which the motion information is not present in the firstcollocated block, in the above-mentioned step (S940), the encoder andthe decoder may also reset both of the L0 input temporal motioninformation and the L1 input temporal motion information. That is, theencoder and the decoder may reset both of the L0 input temporal motioninformation and the L1 input temporal motion information to the motioninformation of the second collocated block and may also perform thebi-directional prediction on the current block.

As still another embodiment, the encoder and the decoder may determinewhether or not they perform the processes of S920 to S940 based on asize of the current block. As an example, the encoder and the decodermay judge whether the size of the current block is smaller than apredetermined size. Here, the current block may be the CU, the PU,and/or the TU, and the predetermined size may be one of, for example,8×8, 16×16, 32×32, and the like. Here, the encoder and the decoder mayperform the processes of S920 to S940 in the case in which the size ofthe current block is smaller than the predetermined size.

As still another embodiment, the encoder and the decoder may alsoperform the processes of S920 to S940 in the case in which the L0 motionvector and/or the L1 motion vector in the motion information of thefirst collocated block correspond to the zero vector (0,0). In thiscase, in the above-mentioned step (S940), the encoder and the decodermay reset the motion vector (motion vectors) corresponding to the zerovector (0,0). As an example, the motion vector (the motion vectors)corresponding to the zero vector (0,0) may be set to the motion vectorof the second collocated block. As another example, the motion vector(the motion vectors) corresponding to the zero vector (0,0) may also beset to the motion vector of the reconstructed neighboring block. Asstill another example, the motion vector (the motion vectors)corresponding to the zero vector (0,0) may also be set to a motionvector of a block positioned around the first collocated block. As stillanother embodiment, the encoder and the decoder may also perform theprocesses of S920 to S940 in the case in which the L0 motion vectorand/or the L1 motion vector in the motion information of the firstcollocated block do not correspond to the zero vector (0,0). In thiscase, in the above-mentioned step (S940), the encoder and the decodermay reset the motion vector (motion vectors) that does not correspond tothe zero vector (0,0). The motion vector (motion vectors) that does notcorrespond to the zero vector (0,0) may be reset to the motion vector ofthe second collocated block.

A condition for determining whether or not the processes of S920 to S940are performed is not limited to the above-mentioned embodiments. Thatis, various conditions may be applied according to a condition and/or aneed.

In the above-mentioned embodiments, since the L0 input temporal motioninformation and the L1 input temporal motion information are thetemporally derived motion information, it is likely that they willcorrespond to motion information by movement of an object. Therefore,the encoder and the decoder may select the motion information that doesnot have the zero vector (0,0) rather than the motion information thathas the zero vector (0,0) when they search the motion information to beused as the final L1 temporal motion information of the current block inthe second collocated block. The reason is that it is likely that theblock having the motion information corresponding to the zero vector(0,0) will correspond to a background rather than the object.

Meanwhile, the reset final L1 temporal motion information may also bethe same as the L0 input temporal motion information of the currentblock. Therefore, the encoder and the decoder may select the motioninformation that is not the same as the L0 input temporal motioninformation when they search the motion information to be used as thefinal L1 temporal motion information of the current block in the secondcollocated block. For example, as in the above-mentioned S940, in thecase in which the final L1 temporal motion information of the currentblock is derived based on the second collocated block, the encoder andthe decoder may determine that a block having motion informationdifferent from the L0 input temporal motion information of the currentblock is a block used to derive the final L1 temporal motioninformation. In this case, the encoder and the decoder may also selectonly motion information having a difference of a predetermined thresholdor less from the L0 input temporal motion information of the currentblock as the motion information to be used as the final L1 temporalmotion information. Here, the predetermined threshold may be determinedbased on the mode information of the current block, the motioninformation of the current block, the mode information of theneighboring block, the motion information of the neighboring block, andthe like, and be determined in various schemes.

Further, in the above-mentioned embodiments, the motion information ofthe second collocated block may include both of the L0 motioninformation and the L1 motion information. In this case, the encoder andthe decoder may determine that one of the L0 motion information and theL1 motion information is the motion information to be used as the finalL1 temporal motion information of the current block. As an example, theencoder and the decoder may use the L0 motion information of the secondcollocated block as the final L1 temporal motion information of thecurrent block. In this case, when the L0 motion information is notpresent in the second collocated block, the encoder and the decoder mayuse the L1 motion information of the second collocated block as thefinal L1 temporal motion information of the current block. As anotherexample, the encoder and the decoder may use the L1 motion informationof the second collocated block as the final L1 temporal motioninformation of the current block. In this case, when the L1 motioninformation is not present in the second collocated block, the encoderand the decoder may use the L0 motion information of the secondcollocated block as the final L1 temporal motion information of thecurrent block.

Meanwhile, the encoder and the decoder may not use the motioninformation of the second collocated block in order to reset the L1input temporal motion information (for example, the L1 input motionvector) of the current block in the above-mentioned step (S940). In thiscase, the encoder and the decoder may reset the L1 input temporal motioninformation (for example, the L1 input motion vector) of the currentblock based on the motion information (for example, the motion vector)of the first collocated block. Hereinafter, embodiments related to thiswill be described based on a motion vector.

As an embodiment, the encoder and the decoder may use the motioninformation indicating a relative position moved from a positionindicated by the motion information (the motion vector) of the firstcollocated block in the first collocated picture based on apredetermined distance and/or direction as the final L1 temporal motioninformation (the L1 motion vector) of the current block. As an example,the encoder and the decoder may use the motion information indicating aposition moved from a position indicated by the motion information ofthe first collocated block in a vertical and/or horizontal direction bya ¼ pixel size (for example, (−1,0), (1,0), (0,−1), (0,1), (−1,−1),(−1,1), (1,−1), (1,1), or the like. Here, a ¼ pixel unit correspondsto 1) as the final L1 temporal motion information of the current block.As another example, the encoder and the decoder may use the motioninformation indicating a position moved from a position indicated by themotion information of the first collocated block in the vertical and/orhorizontal direction by a ½ pixel size (for example, (−2,0), (2,0),(0,−2), (0,2), (−2,−2), (−2,2), (2,−2), (2,2), or the like. Here, a ¼pixel unit corresponds to 1) as the final L1 temporal motion informationof the current block. As still another example, the encoder and thedecoder may use the motion information indicating a position moved froma position indicated by the motion information of the first collocatedblock in the vertical and/or horizontal direction by an integer pixelsize (for example, (−4,0), (4,0), (0,−4), (0,4), (−4,−4), (−4,4),(4,−4), (4,4), or the like. Here, a ¼ pixel unit corresponds to 1) asthe final L1 temporal motion information of the current block.Meanwhile, since the motion vector includes a vertical directioncomponent and a horizontal direction component, the above-mentionedmethods (the movement by the ¼ pixel size, the movement by the ½ pixelsize, the movement by the integer pixel size) may also be independentlyapplied to each of the horizontal direction component and the verticaldirection component. In this case, a movement distance in the horizontaldirection and a movement distance in the vertical direction may also bedifferent from each other.

As another embodiment, the encoder and the decoder may change the motioninformation (the motion vector) value of the first collocated block intoa value of other pixel unit and then use the changed value as the finalL1 temporal motion information (the L1 motion vector) of the currentblock. As an example, in the case in which the motion information valueof the first collocated block is a value of the ¼ pixel unit, theencoder and the decoder may change the motion information value of thefirst collocated block into a value of a ½ pixel unit based on a shiftoperation, or the like, and use the changed value as the final L1temporal motion information of the current block. As another example, inthe case in which the motion information value of the first collocatedblock is a value of a ½ pixel unit, the encoder and the decoder maychange the motion information value of the first collocated block into avalue of an integer pixel unit based on the shift operation, or thelike, and uses the changed value as the final L1 temporal motioninformation of the current block.

The method of resetting the L1 input temporal motion information (forexample, the L1 input motion vector) of the current block based on themotion information (for example, the motion vector) of the firstcollocated block is not limited to the above-mentioned embodiments, butmay be variously applied in various forms according to an implementationand/or a need. In addition, the methods according to the above-mentionedembodiment may be equally or similarly applied to the case of resettingthe L1 input temporal motion information based on the motion informationof the second collocated block as shown in step (S940) of FIG. 9.

Meanwhile, in the above-mentioned embodiment, the input temporal motioninformation input to step (S910) may include an input reference pictureindex as well as an input motion vector. Here, the L0 input motionvector and the L1 input motion vector may be a motion vector temporallyderived based on the first collocated block as described above, and theL0 input reference picture index and the L1 input reference pictureindex may be a reference picture index spatially derived from thereconstructed neighboring block. Here, the L0 input reference pictureindex and the L1 input reference picture index may be set to thenon-negative smallest value among the reference picture indices of thereconstructed neighboring block. Meanwhile, as another example, an L0input reference picture index and an L1 input reference picture indexmay also be set to 0 regardless of the motion information of thereconstructed neighboring block.

In the case in which the L1 input motion vector is reset based on thesecond collocated block, the resetting process may also be performed onthe L1 input reference picture index. Hereinafter, embodiments of aprocess of resetting the L1 input reference picture index will bedescribed.

As an example, the encoder and the decoder may reset the L1 inputreference picture index based on the second collocated block. Asdescribed above, the encoder and the decoder may use the motioninformation of the second collocated block as the final L1 temporalmotion information of the current block. In this case, the encoder andthe decoder may reset the L1 input reference picture index to thereference picture index of the second collocated block to derive a finalL1 reference picture index. As another embodiment, the encoder and thedecoder may reset the L1 input reference picture index to apredetermined fixed reference picture index value to derive a final L1reference picture index.

As still another embodiment, in the case in which the L0 input temporalmotion information (for example, the L0 input motion vector, the L0input reference picture index, and the like) and L1 input temporalmotion information (for example, the L1 motion vector, the L1 inputreference picture index, and the like) are the same as each other, theencoder and the decoder may reset both of the L0 input reference pictureindex and the L1 input reference picture index to a value of 0 to usethe reset value as final temporal motion information. The reason is thatin the case in which the L0 input temporal motion information and the L1input temporal motion information are the same as each other, it islikely that both of the L0 reference picture index and the L1 referencepicture index will be 0.

As still another embodiment, the encoder and the decoder may reset theL1 input reference picture index value to the same value as that of theL0 input reference picture index. On the other hand, the encoder and thedecoder may also reset the L1 input reference picture index value to thereference picture index value that is not the same as that of the L0input reference picture index. Reference picture indices that are notthe same as the L0 input reference picture index among the referencepicture indices of the reconstructed neighboring blocks may be present.In this case, for example, the encoder and the decoder may use the mostfrequently used reference picture index among the reference pictureindices that are not the same as the L0 input reference picture index inorder to reset the L1 input reference picture index. As another example,the encoder and the decoder may also use the reference picture indexhaving the non-negative smallest value among the reference pictureindices that are not the same as the L0 input reference picture index inorder to reset the L1 input reference picture index.

Meanwhile, as described above, the encoder and the decoder may reset theL1 input motion vector value to the same value as that of the motionvector of the second collocated block to derive a final L1 temporalmotion vector. In this case, the motion vector of the second collocatedblock may also be scaled and used according to the L1 input referencepicture index and/or the reset L1 reference picture index. The L1 inputreference picture index may be used as the final L1 reference pictureindex as it is without being subjected to the resetting process or besubjected to the resetting process and then used as the final L1reference picture index as in the above-mentioned embodiment. Here, areference picture corresponding to the motion vector of the secondcollocated block and a reference picture indicated by the final L1reference picture index may be different from each other. In this case,the encoder and the decoder may perform scaling on the motion vector ofthe second collocated block and use the scaled motion vector as thefinal L1 temporal motion vector of the current block.

The above-mentioned embodiments may be combined with each otheraccording to the process of resetting the motion vector and the processof resetting the reference picture index (for example, RefIdxLX, X=0,1).Hereinafter, in embodiments to be described below, it is assumed thatthe L1 input motion vector is reset based on the second collocatedblock. That is, it is assumed that the encoder and the decoder reset theL1 input motion vector to one of the motion vectors of the secondcollocated blocks.

As an embodiment, the encoder and the decoder may use the firstcollocated picture used to derive the L0 input temporal motioninformation as the second collocated picture as it is, and the secondcollocated block may be derived from the second collocated picture. Inthis case, the encoder and the decoder may scale and use the motionvector of the second collocated block in order to reset the L1 inputmotion vector. In this case, the scaled motion vector may be used as thefinal L1 temporal motion information. In this case, as an example, theL1 input reference picture index may be used as the final L1 temporalmotion information as it is without being subjected to the resettingprocess. That is, the encoder and the decoder may allocate the L1 inputreference picture index to the L1 temporal motion information of thecurrent block as it is. As another example, the L1 input referencepicture index value may also be reset to a predetermined fixed referencepicture index value. That is, the encoder and the decoder may allocate apredetermined fixed reference picture index value to the L1 temporalmotion information of the current block, and the predetermined fixedreference picture index may be used as the final L1 temporal motioninformation.

As another embodiment, the encoder and the decoder may use the firstcollocated picture used to derive the L0 input temporal motioninformation as the second collocated picture as it is, and the secondcollocated block may be derived from the second collocated picture, asin the above-mentioned embodiment. In this case, the encoder and thedecoder may derive a motion vector that is not same as the L0 inputmotion vector and has a difference of a predetermined threshold or lessfrom the L0 input motion vector among the motion vectors of the secondcollocated blocks in order to reset the L1 input motion vector. Theencoder and the decoder may perform scaling on the derived motionvector, and the scaled motion vector may be used as the final L1temporal motion information. In this case, as an example, the L1 inputreference picture index may be used as the final L1 temporal motioninformation as it is without being subjected to the resetting process.That is, the encoder and the decoder may allocate the L1 input referencepicture index to the L1 temporal motion information of the current blockas it is. As another example, the L1 input reference picture index valuemay also be reset to a predetermined fixed reference picture indexvalue. That is, the encoder and the decoder may allocate a predeterminedfixed reference picture index value to the L1 temporal motioninformation of the current block, and the predetermined fixed referencepicture index may be used as the final L1 temporal motion information.

As still another embodiment, the encoder and the decoder may also use areference picture that is not the same as the first collocated pictureused to derive the L0 input temporal motion information as the secondcollocated picture. Here, the second collocated picture may be areference picture that is not the same as the first collocated pictureand is most recently decoded among the reference pictures in the L1reference picture list. As another example, the encoder and the decodermay also select the reference picture most frequently used based on thereference picture number of the reconstructed neighboring block as thesecond collocated picture. The second collocated block may be derivedfrom the second collocated picture. In this case, the encoder and thedecoder may scale and use the motion vector of the second collocatedblock in order to reset the L1 input motion vector. In this case, thescaled motion vector may be used as the final L1 temporal motioninformation. In this case, as an example, the L1 input reference pictureindex may be used as the final L1 temporal motion information as it iswithout being subjected to the resetting process. That is, the encoderand the decoder may allocate the L1 input reference picture index to theL1 temporal motion information of the current block as it is. As anotherexample, the L1 input reference picture index value may also be reset toa predetermined fixed reference picture index value. That is, theencoder and the decoder may allocate a predetermined fixed referencepicture index value to the L1 temporal motion information of the currentblock, and the predetermined fixed reference picture index may be usedas the final L1 temporal motion information.

As another embodiment, the encoder and the decoder may use the referencepicture that is not the same as the first collocated picture used toderive the L0 input temporal motion information as the second collocatedpicture, and the second collocated block may be derived from the secondcollocated picture, as in the above-mentioned embodiment. Here, thesecond collocated picture may be a reference picture that is not thesame as the first collocated picture and is most recently decoded amongthe reference pictures in the L1 reference picture list. As anotherexample, the encoder and the decoder may also select the referencepicture most frequently used based on the reference picture number ofthe reconstructed neighboring block as the second collocated picture. Inthis case, the encoder and the decoder may derive a motion vector thatis not same as the L0 input motion vector and has a difference of apredetermined threshold or less from the L0 input motion vector amongthe motion vectors of the second collocated blocks in order to reset theL1 input motion vector. The encoder and the decoder may perform scalingon the derived motion vector, and the scaled motion vector may be usedas the final L1 temporal motion vector. In this case, as an example, theL1 input reference picture index may be used as the final L1 temporalmotion information as it is without being subjected to the resettingprocess. That is, the encoder and the decoder may allocate the L1 inputreference picture index to the L1 temporal motion information of thecurrent block as it is. As another example, the L1 input referencepicture index value may also be reset to a predetermined fixed referencepicture index value. That is, the encoder and the decoder may allocate apredetermined fixed reference picture index value to the L1 temporalmotion information of the current block, and the predetermined fixedreference picture index may be used as the final L1 temporal motioninformation.

A combination of the embodiments of the process of resetting the motionvector and the process of resetting the reference picture index is notlimited to the above-mentioned embodiment, but may be provided invarious forms according to an implementation and/or a need.

Meanwhile, the reset L1 temporal motion information may be the same asthe L0 temporal motion information of the current block. Therefore, whenthe reset L1 temporal motion information is the same as the L0 temporalmotion information of the current block, the encoder and the decoder mayreset the prediction direction information of the current block to theuni-directional prediction. In this case, the encoder and the decodermay use only the L0 temporal motion information as the temporal motioninformation of the current block. This method, which is a combinationwith the above-mentioned embodiments, may be applied to the presentinvention.

FIG. 10 is a diagram schematically showing an embodiment of a secondcollocated block used to reset L1 temporal motion information.

The encoder and the decoder may determine the second collocated blockbased on a collocated block present at the spatially same position asthat of the current block within the second collocated picture. In FIG.10, a block 1010 indicates a current block and a block 1020 indicates acollocated block in the second collocated picture. Here, the secondcollocated picture may be determined in various schemes.

As an embodiment, the encoder and the decoder may determine that one ofthe reference pictures included in the L0 reference picture list is thesecond collocated picture. As an example, the encoder and the decodermay determine that a first reference picture in the L0 reference picturelist is the second collocated picture. As another example, the encoderand the decoder may determine that a second reference picture in the L0reference picture list is the second collocated picture. As stillanother example, the encoder and the decoder may determine that a thirdreference picture in the L0 reference picture list is the secondcollocated picture. As still another example, the encoder and thedecoder may determine that a fourth reference picture in the L0reference picture list is the second collocated picture.

As another embodiment, the encoder and the decoder may determine thatone of the reference pictures included in the L1 reference picture listis the second collocated picture. As an example, the encoder and thedecoder may determine that a first reference picture in the L1 referencepicture list is the second collocated picture. As another example, theencoder and the decoder may determine that a second reference picture inthe L1 reference picture list is the second collocated picture. As stillanother example, the encoder and the decoder may determine that a thirdreference picture in the L1 reference picture list is the secondcollocated picture. As still another example, the encoder and thedecoder may determine that a fourth reference picture in the L1reference picture list is the second collocated picture.

As another embodiment, the encoder and the decoder may use a referencepicture providing the highest encoding efficiency among all referencepictures (and/or some reference pictures determined according to apredetermined condition) in the L0 reference picture list and the L1reference picture list as the second collocated picture. Here, theencoding efficiency may be determined based on motion information of ablock present at a position corresponding to that of the secondcollocated position in each reference picture. Here, the encoder mayderive the second collocated picture based on the encoding efficiencyand transmit the second collocated picture information indicating thesecond collocated picture to the decoder. The decoder may determine thesecond collocated picture based on the transmitted second collocatedpicture information.

In the above-mentioned embodiments, the encoder and the decoder may alsodetermined that only the reference picture that is not the same as thefirst collocated picture used to derive the L0 input temporal motioninformation is the second collocated picture. In this case, only thereference picture that is not the same of the first collocated picturemay be used to derive the final L1 temporal motion information of thecurrent block.

The method of determining the second collocated picture is not limitedto the above-mentioned embodiment. That is, the second collocatedpicture may also be determined in other schemes according to animplementation and/or a need.

Meanwhile, in the embodiment of FIG. 10, a block positioned at thecenter of an inner portion of the collocated block 1020 will be called ablock D, a block positioned at a left upper corner of the inner portionof the collocated block 1020 will be called a block S, a blockpositioned at a left lower corner of the inner portion of the collocatedblock 1020 will be called a block Q, a block positioned at a right uppercorner of the inner portion of the collocated block 1020 will be calleda block R, and a block positioned at a right lower corner of the innerportion of the collocated block 1020 will be called a block C. Inaddition, a block positioned at the uppermost portion among blocksadjacent to the left of the collocated block 1020 will be called a blockF, a block positioned at the lowermost portion among the blocks adjacentto the left of the collocated block 1020 will be called a block J, ablock positioned at the leftmost portion among blocks adjacent to anupper portion of the collocated block 1020 will be called a block G, ablock positioned at the rightmost portion among the blocks adjacent tothe upper portion of the collocated block 1020 will be called a block M,a block positioned at the uppermost portion among blocks adjacent to theright of the collocated block 1020 will be called a block N, a blockpositioned at the lowermost portion among the blocks adjacent to theright of the collocated block 1020 will be called a block B, a blockpositioned at the leftmost portion among blocks adjacent to a lowerportion of the collocated block 1020 will be called a block K, and ablock positioned at the rightmost portion among the blocks adjacent tothe lower portion of the collocated block 1020 will be called a block A.Further, a block positioned at a left upper corner of an outer portionof the collocated block 1020 will be called a block E, a blockpositioned at a left lower corner of the outer portion of the collocatedblock 1020 will be called a block I, a block positioned at a right uppercorner of the outer portion of the collocated block 1020 will be calleda block L, and a block positioned at a right lower corner of the outerportion of the collocated block 1020 will be called a block H. Inaddition, a block positioned to be adjacent to the right of the block Bwill be called a block P, and a block positioned to be adjacent to alower portion of the block A will be called a block O.

As described above in the embodiment of FIG. 9, the encoder and thedecoder may use the motion information of the second collocated block asthe final L1 temporal motion information of the current block accordingto a predetermined condition. That is, the encoder and the decoder mayreset the L1 input temporal motion information value to the motioninformation value of the second collocated block. In this case, thesecond collocated block and/or the motion information used as the finalL1 temporal motion information may be derived by various methods.

As an embodiment, the encoder and the decoder may derive the motioninformation used as the final L1 temporal motion information from oneblock present at a predetermined position based on the collocated blockamong blocks positioned at the inner and outer portions of thecollocated block. In this case, one block present at the predeterminedposition may correspond to the second collocated block. Here, the blockpresent at the predetermined position may be a block A, a block B, ablock C, a block D, a block E, a block F, a block G, a block H, a blockI, a block J, a block K, a block L, a block M, a block N, a block O, ablock P, a block Q, a block R, or a block S.

As another embodiment, the encoder and the decoder may scan a pluralityof blocks present at the predetermined positions among the blockspositioned at the inner and outer portions of the collocated blocks in apredetermined order. In this case, the encoder and the decoder may usethe motion information of the first block in which the motioninformation is present in scan order as the final L1 temporal motioninformation of the current block. Here, the first block in which themotion information is present may correspond to the second collocatedblock. A scan target block and a scan order may be determined in variousforms. As an example, the encoder and the decoder may scan the blocks inorder to the block H, the block D, the block A, the block B, the blockC, the block I, the block J, the block F, the block G, and the block E.

As still another embodiment, the encoder and the decoder may derive anintermediate value of the motion information of the plurality of blockspresent at the predetermined positions among the blocks positioned atthe inner and outer portions of the collocated block and use the derivedintermediate value as the final L1 temporal motion information of thecurrent block. As an example, the plurality of blocks may be the blockH, the block D, the block A, the block B, the block C, the block I, theblock J, the block F, the block G, and the block E.

The method of deriving the L1 temporal motion information of the currentblock from the second collocated block is not limited thereto. That is,the L1 temporal motion information of the current block may be derivedby various methods according to an implementation and/or a need.

FIG. 11 is a block diagram schematically showing an embodiment of aninter prediction apparatus capable of performing the process of derivingtemporal motion information according to the embodiment of FIG. 9. Theinter prediction apparatus according to the embodiment of FIG. 11 mayinclude a temporal motion information judging unit 1110, a secondcollocated block motion information judging unit 1120, a predictiondirection information resetting and L0 motion information setting unit1130, and an L1 temporal motion information resetting unit 1140.

Referring to FIG. 11, the temporal motion information judging unit 1110may judge whether or not the L0 input temporal motion information andthe L1 input temporal motion information in the input temporal motioninformation are the same as each other, that is, whether or not the L0input reference picture number and the L1 input reference picture numberare the same as each other and the L0 input motion vector and the L1input motion vector are the same as each other.

In the case in which the L0 input temporal motion information and the L1input temporal motion information are not the same as each other, theinter prediction apparatus may use the input temporal motion informationas the temporal motion information of the current block as it is. In thecase in which the AMVP is applied, the temporal motion information ofthe current block may be determined or registered to be a predictionmotion vector candidate for the current block. Further, in the case inwhich the merge is applied, the temporal motion information of thecurrent block may be determined or registered to be a merge candidatefor the current block. In the case in which the L0 input temporal motioninformation and the L1 input temporal motion information are the same aseach other, a judging process by the second collocated block motioninformation judging unit 1120 may be performed.

Meanwhile, as described above with reference to FIG. 9, the temporalmotion information judging unit 1110 may also judge whether or not theL0 input reference picture number and the L1 input reference picturenumber are the same as each other rather than whether or not the L0input temporal motion information and the L1 input temporal motioninformation are the same as each other or a prediction direction of thefirst collocated block. For example, in the case in which the L0 inputreference picture number and the L1 input reference picture number arenot the same as each other, the inter prediction apparatus may use theinput temporal motion information as the temporal motion information ofthe current block as it is, and in the case in which the L0 inputreference picture number and the L1 input reference picture number arethe same as each other, the judging process by the second collocatedblock motion information judging unit 1120 may be performed. As anotherexample, in the case in which the prediction direction of the firstcollocated block is the bi-directional prediction, the inter predictionapparatus may use the input temporal motion information as the temporalmotion information of the current block as it is, and in the case inwhich the prediction direction of the first collocated block is theuni-directional prediction, the judging process by the second collocatedblock motion information judging unit 1120 may be performed.

The second collocated block motion information determining unit 1120 mayjudge whether the motion information of the second collocated block ispresent. In the case in which the motion information of the secondcollocated block is not present (for example, in the case in which theblock having the motion information among the second collocated blockspositioned at predetermined positions and/or positions selected by apredetermined method is not present), a prediction direction informationresetting and L0 motion information setting process by the predictiondirection information resetting and L0 motion information setting unit1130 may be performed. Further, in the case in which the motioninformation of the second collocated block is present (for example, inthe case in which the block having the motion information among thesecond collocated blocks positioned at the predetermined positionsand/or the positions selected by the predetermined method is present), aresetting process by the L1 temporal motion information resetting unit1140 may be performed.

In the case in which the motion information of the second collocatedblock is not present, the prediction direction information resetting andL0 motion information setting unit 1130 may reset the predictiondirection information of the current block to the unit-directionalperdition. In addition, in this case, the prediction directioninformation resetting and L0 motion information setting unit 1130 mayset only the L0 input temporal motion information among the inputtemporal motion information to the final temporal motion information ofthe current block.

In the case in which the motion information of the second collocatedblock is present, the L1 temporal motion information resetting unit 1140may reset the L1 input temporal motion information of the current blockto the motion information of the second collocated block. That is, theinter prediction apparatus may use the motion information of the secondcollocated block as the final L1 temporal motion information of thecurrent block. In this case, when the motion information of the secondcollocated block includes the zero vector (0,0), the L1 temporal motioninformation resetting unit 1140 may also use the motion information ofthe block positioned around the second collocated block as the final L1temporal motion information of the current block. Since specificembodiments of each of the above-mentioned methods have been describedwith reference to FIGS. 6 and 7, a description thereof will be omitted.

FIG. 12 is a flow chart schematically showing an embodiment of a methodof deriving motion information of a current block according to thepresent invention.

As described above, the encoder and the decoder may derive the motioninformation of the current block based on the motion information of thereconstructed neighboring block and/or the motion information of thecollocated block. Here, the reconstructed neighboring block, which is ablock in a previously encoded and/or decoded and reconstructed currentpicture, may include blocks adjacent to the current block and/or blockspositioned at an outer corner of the current block. In addition, thecollocated block means a block corresponding to the current block in thecollocated picture, and the collocated picture may correspond to one ofthe reference pictures in the reference picture list as an example.Here, the motion information derived from the reconstructed neighboringblock may be called spatial motion information, and the motioninformation derived from the collocated block may be called temporalmotion information. Here, each of the spatial motion information and thetemporal motion information may include prediction directioninformation, an L0 reference picture number, an L1 reference picturenumber, an L0 motion vector, an L1 motion vector, and the like.

Meanwhile, in an image decoding process, due to excessive traffic of anetwork, a picture that is not decoded among the previous pictures ofthe current picture (and/or the decoding target picture) may be present.In this case, since an erroneous collocated block may be used in theprocess of deriving the temporal motion information for the block in thecurrent picture and accurate temporal motion information may not bederived, the current picture may not be appropriately decoded.Therefore, in order to solve these problems, the encoder and the decodermay spatially derive one of the L0 motion information and the L1 motioninformation based on the reconstructed neighboring block and temporallyderive the other thereof based on the collocated block, in deriving themotion information of the current block. That is, the encoder and thedecoder may independently set each of the L0 motion information and theL1 motion information. In this case, even through the previous picturethat is not decoded is present, the encoder and the decoder mayreconstruct the current block to some degree.

Referring to FIG. 12, the encoder and the decoder may set the L0 motioninformation (1210). At the time, the encoder and the decoder may use themotion information (the spatial motion information) spatially derivedbased on the reconstructed neighboring block as the L0 motioninformation or use the motion information (the temporal motioninformation) temporally derived based on the collocated block as the L0motion information. That is, the L0 motion information may be spatiallyderived based on the reconstructed neighboring block or be temporallyderived based on the collocated block.

Again referring to FIG. 12, the encoder and the decoder may set the L1motion information (1220). At the time, the encoder and the decoder mayuse the motion information (the spatial motion information) spatiallyderived based on the reconstructed neighboring block as the L1 motioninformation or use the motion information (the temporal motioninformation) temporally derived based on the collocated block as the L1motion information. That is, the L1 motion information may be spatiallyderived based on the reconstructed neighboring block or be temporallyderived based on the collocated block.

As an embodiment, in the case in which the L0 motion information is themotion information temporally derived based on the collocated block, theencoder and the decoder may use the spatial motion information derivedbased on the reconstructed neighboring block as the L1 motioninformation. As an embodiment, in the case in which the L0 motioninformation is the motion information spatially derived based on thereconstructed neighboring block, the encoder and the decoder may use thetemporal motion information derived based on the collocated block as theL1 motion information.

Meanwhile, in the above-mentioned embodiment, the encoder and thedecoder may also derive the L1 motion information based on the L0 motioninformation. As an example, it is assumed that the L0 motion informationis the motion information derived based on the collocated block. In thiscase, as described above, the encoder and the decoder may use thespatial motion information spatially derived based on the reconstructedneighboring block as the L1 motion information. In this case, as anexample, the encoder and the decoder may derive only the motioninformation that is the same as or similar to the L0 motion informationas the spatial motion information to be used as the L1 motioninformation. As another example, the encoder and the decoder may alsoderive only the motion information that is not the same as the L0 motioninformation as the spatial motion information to be used as the L1motion information. In this case, the encoder and the decoder may alsoderive only the motion information having a difference of apredetermined threshold or less from the L0 motion information as thespatial motion information to be used as the L1 motion information.Here, the predetermined threshold may be determined based on the modeinformation of the current block, the motion information of the currentblock, the mode information of the neighboring block, the motioninformation of the neighboring block, and the like, and be determined invarious schemes.

The method of setting the L0 motion information and the L1 motioninformation is not limited to the above-mentioned embodiment, but may bechanged according to an implementation and a need.

Meanwhile, in the case in which the L0 motion information and/or the L1motion information are spatially derived based on the motion informationof the reconstructed neighboring block, the motion information of thereconstructed neighboring block may also include both of the spatiallyderived spatial motion information and the temporally derived temporalmotion information. In this case, the encoder and the decoder may derivethe L0 motion information of the current block and/or the L1 motioninformation of the current block using only the spatially derivedspatial motion information among the motion information of thereconstructed neighboring block.

Again referring to FIG. 12, the encoder and the decoder may integratethe L0 motion information and the L1 motion information with each otherto derive the motion information of the current block (1230).

Meanwhile, the L0 motion information and the L1 motion information inthe derived motion information of the current block may also be the sameas each other. Therefore, in the case in which the L0 motion informationand the L1 motion information are the same as each other, the encoderand the decoder may reset the prediction direction information of thecurrent block to the uni-directional prediction. In this case, theencoder and the decoder may use only the L0 motion information as themotion information of the current block.

FIG. 13 is a block diagram schematically showing an embodiment of aninter prediction apparatus capable of performing the process of derivingmotion information according to the embodiment of FIG. 12. The interprediction apparatus according to the embodiment of FIG. 13 may includean L0 motion information setting unit 1310, an L1 motion informationsetting unit 1320, and a motion information integrating unit 1330.

As described above in the embodiment of FIG. 12, the encoder and thedecoder may independently set each of the L0 motion information and theL1 motion information. In this case, the encoder and the decoder mayspatially derive one of the L0 motion information and the L1 motioninformation based on the reconstructed neighboring block and temporallyderive the other thereof based on the collocated block.

Referring to 13, the L0 motion information setting unit 1310 may set theL0 motion information. At the time, the encoder and the decoder may usethe motion information (the spatial motion information) spatiallyderived based on the reconstructed neighboring block as the L0 motioninformation or use the motion information (the temporal motioninformation) temporally derived based on the collocated block as the L0motion information. That is, the L0 motion information may be spatiallyderived based on the reconstructed neighboring block or be temporallyderived based on the collocated block.

Again referring to 13, the L1 motion information setting unit 1320 mayset the L1 motion information. At the time, the encoder and the decodermay use the motion information (the spatial motion information)spatially derived based on the reconstructed neighboring block as the L1motion information or use the motion information (the temporal motioninformation) temporally derived based on the collocated block as the L1motion information. That is, the L1 motion information may be spatiallyderived based on the reconstructed neighboring block or be temporallyderived based on the collocated block.

Since a specific embodiment of the method of setting the L0 motioninformation and the L1 motion information has been described withreference to FIG. 12, a description thereof will be omitted.

Again referring to FIG. 13, the motion information integrating unit 1330may integrate the L0 motion information set in the L0 motion informationsetting unit 1310 and the L1 motion information set in the L1 motioninformation setting unit 1320 with each other to derive the motioninformation of the current block.

FIG. 14 is a flow chart schematically showing still another embodimentof a method of deriving temporal motion information of a current blockaccording to the present invention.

Although embodiments to be described below will be described based onthe temporal motion information, the present invention is not limitedthereto. For example, the method according to the embodiment of FIG. 14may be equally or similarly applied to the motion information of thecurrent block derived based on the merge candidate list in the mergemode and/or the motion information of the current block derived based onthe prediction motion vector candidate list in the AMVP mode as well asthe temporal motion information in the merge mode and/or the AMVP mode.

As described above, the temporal motion information may be derived basedon the motion information of the collocated block corresponding to thecurrent block within the previously reconstructed collocated picture.Here, the collocated picture may correspond to one of reference picturesincluded in a reference picture list as an example. The encoder and thedecoder may determine a predetermined relative position based on theblock present at the spatially same position as that of the currentblock in the collocated picture and derive the collocated block based onthe determined predetermined relative position (for example, thepositions of the inner portion and/or the outer portion of the blockpresent at the spatially same position as that of the current block).The temporal motion information derived based on the collocated blockmay include prediction direction information, an L0 reference picturenumber, an L1 reference picture number, an L0 motion vector, an L1motion vector, and the like.

Referring to FIG. 14, the encoder and the decoder may judge whether ornot the L0 temporal motion information and the L1 temporal motioninformation in the temporal motion information derived based on thecollocated block are the same as each other, that is, whether or not theL0 reference picture number and the L1 reference picture number are thesame as each other and the L0 motion vector and the L1 motion vector arethe same as each other (S1410).

Hereinafter, in embodiments of FIGS. 14 and 15 to be described below,for convenience of explanation, the temporal motion information input tostep (S1410) before resetting the temporal motion information will becalled input temporal motion information (L0 input temporal motioninformation and L1 input temporal motion information). In this case, theinput temporal motion information may correspond to the temporal motioninformation derived based on the collocated block. In addition, a motionvector included in the input temporal motion information will be calledan input motion vector (an L0 input motion vector and an L1 input motionvector), a reference picture index included in the input temporal motioninformation will be called an input reference picture index (an L0 inputreference picture index and an L1 input reference picture index), and areference picture number included in the input temporal motioninformation will be called an input reference picture number (an L0input reference picture number and an L1 input reference picturenumber). In addition, in embodiments to be described below, a referencepicture indicated by an L0 input reference picture number will be calledan L0 reference picture, and a reference picture indicated by an L1input reference picture number will be called an L1 reference picture.

In the case in which the L0 temporal motion information and the L1temporal motion information are not the same as each other, that is, inthe case in which the L0 reference picture number and the L1 referencepicture number are not the same as each other and/or the L0 motionvector and the L1 motion vector are not the same as each other, theencoder and the decoder may use the input temporal motion informationderived based on the collocated block as the final temporal motioninformation of the current block as it is. In the case in which the AMVPis applied, the final temporal motion information may be determined orregistered to be a prediction motion vector candidate for the currentblock. Further, in the case in which the merge is applied, the finaltemporal motion information may be determined or registered to be amerge candidate for the current block.

In the case in which the L0 input temporal motion information and the L1input temporal motion information are the same as each other, theencoder and the decoder may search or derive the motion information tobe used as the final L1 temporal motion information in the L1 referencepicture (S1420). Here, since the L0 input temporal motion informationand the L1 input temporal motion information are the same as each other,the L1 reference picture may correspond to the same picture as the L0reference picture. Therefore, in embodiments to be described below, theL1 reference picture means the same picture as the L0 reference picture.

As an example, the encoder and the decoder may search and derive themotion information from the L1 reference picture by the same method. Inthis case, the encoder may not transmit the motion information derivedfrom the L1 reference picture to the decoder. As another example, theencoder may derive the motion information from the L1 reference pictureby a predetermined method and then allow the derived motion informationto be included in a bit stream and be transmitted to the decoder. Inthis case, the decoder may determine the motion information to be usedas the final L1 temporal motion information based on the transmittedmotion information. The motion information derived in the encoder mayinclude the reference picture index, the motion vector, and the like,and the encoder may independently transmit each of the reference pictureindex and the motion vector to the decoder. In this case, the encodermay also calculate a difference value between an actual motion vector ofthe current block and the motion vector derived from the L1 referencepicture and then transmit the difference value to the decoder.

Again referring to FIG. 14, the encoder and the decoder may use themotion information derived from the L1 reference picture as the final L1temporal motion information of the current block (S1430). That is, atthe time, the encoder and the decoder may reset the L1 input temporalmotion information value to the motion information value derived fromthe L1 reference picture.

Hereinafter, embodiments of a method of deriving the motion informationto be used as the final L1 temporal motion information from the L1reference picture will be described.

As an embodiment, the encoder and the decoder may use the motioninformation indicating a position present in a predetermined range basedon a position indicated by the L0 input temporal motion information(motion vector) in the L1 reference picture as the final L1 temporalmotion information (the L1 motion vector). More specifically, thepredetermined range may correspond to a range including a position in adistance of +T and/or −T in the vertical and/or horizontal directions,based on a position indicated by the L0 input temporal motioninformation within the L1 reference picture. Here, as an example, T maybe a value indicating a distance of a ¼ pixel unit. As another example,T may be a value indicating a distance of a ½ pixel unit. As stillanother example, T may also be a value indicating a distance of aninteger pixel unit. In the case in which the integer pixel unit is used,since an interpolation process may not be performed at the time ofmotion compensation, computational complexity may be reduced.

As another example, the encoder may derive a region that is mostappropriately matched or similar to an input block (an original block)corresponding to the current block in the L1 reference picture. In thiscase, the encoder may derive the motion information to be used as thefinal L1 temporal motion information of the current block based on thederived region. As an example, the encoder may derive the motion vectorto be used as the final L1 temporal motion information based on theposition of the block corresponding to the derived region and theposition of the current block and derive the reference picture index(and/or the reference picture number) to be used as the final L1temporal motion information based on the block corresponding to thederived region. The derived motion information may be included in thebit stream and then transmitted from the encoder to the decoder. In thiscase, the decoder may reset the L1 input temporal motion informationbased on the transmitted motion information.

The reference picture index (and/or the reference picture number)derived from the L1 reference picture may be different from the L1 inputreference picture index (and/or the L1 input reference picture number).In this case, the encoder and the decoder may use the reference pictureindex (and/or the reference picture number) derived from the L1reference picture as the final L1 temporal motion information of thecurrent block.

The method of deriving the motion information to be used as the final L1temporal motion information based on the L1 reference picture is notlimited to the above-mentioned embodiment. That is, the encoder and thedecoder may also derive the motion information in other schemesaccording to an implementation and/or a need.

Meanwhile, although whether or not processes of S1420 to S1430 areperformed is determined based on the sameness of the L0 input temporalmotion information and the L1 input temporal motion information in theabove-mentioned embodiment, the encoder and the decoder may alsodetermine whether or not they perform the processes of S1420 to S1430based on other conditions.

As an embodiment, the encoder and the decoder may determine whether ornot they perform the processes of S1420 to S1430 based on a predictiondirection of the collocated block. As described above, the predictiondirection information means information indicating whether theuni-directional prediction or the bi-directional prediction is appliedto the block on which the prediction is performed. Therefore, theprediction direction may correspond to the uni-directional predictionand the bi-directional prediction. As an example, the encoder and thedecoder may perform the processes of S1420 to S1430 in the case in whichthe motion information (the prediction direction) of the collocatedblock is the uni-directional prediction rather than the bi-directionalprediction. The reason is that in the case in which the predictiondirection of the first collocated block is the uni-directionalprediction, the L0 input temporal motion information and the L1 inputtemporal motion information in the input temporal motion informationderived from the first collocated block may be the same as each other.

As another embodiment, the encoder and the decoder may determine whetheror not they perform the processes of S1420 to S1430 based on informationon whether or not the motion information is present in the collocatedblock. As an example, the encoder and the decoder may perform theprocesses of S1420 to S1430 in the case in which the motion informationis not present in the collocated block. In this case, in theabove-mentioned step (S1430), the L0 input temporal motion informationrather than the L1 input temporal motion information may be reset. Thatis, the encoder and the decoder may reset the L0 input temporal motioninformation to the motion information of the L1 reference picture andperform the uni-directional prediction rather than the bi-directionalprediction on the current block. In addition, in the case in which themotion information is not present in the collocated block, in theabove-mentioned step (S1430), the encoder and the decoder may also resetboth of the L0 input temporal motion information and the L1 inputtemporal motion information. That is, the encoder and the decoder mayreset both of the L0 input temporal motion information and the L1 inputtemporal motion information to the motion information of the L1reference picture and may also perform the bi-directional prediction onthe current block.

As still another embodiment, the encoder and the decoder may alsoperform the processes of S1420 to S1430 in the case in which the L0motion vector and/or the L1 motion vector in the motion information ofthe collocated block correspond to the zero vector (0,0). In this case,in the above-mentioned step (S1430), the encoder and the decoder mayreset the motion vector (motion vectors) corresponding to the zerovector (0,0). As an example, the motion vector (the motion vectors)corresponding to the zero vector (0,0) may be set to the motion vectorof the L1 reference picture. As another example, the motion vector (themotion vectors) corresponding to the zero vector (0,0) may also be setto the motion vector of the reconstructed neighboring block. As stillanother example, the motion vector (the motion vectors) corresponding tothe zero vector (0,0) may also be set to a motion vector of a blockpositioned around the collocated block. As still another embodiment, theencoder and the decoder may also perform the processes of S1420 to S1430in the case in which the L0 motion vector and/or the L1 motion vector inthe motion information of the collocated block do not correspond to thezero vector (0,0). In this case, in the above-mentioned step (S1430),the encoder and the decoder may reset the motion vector (motion vectors)that does not correspond to the zero vector (0,0). The motion vector(motion vectors) that does not correspond to the zero vector (0,0) maybe reset to the motion vector of the L1 reference picture.

A condition for determining whether or not the processes of S1420 toS1430 are performed is not limited to the above-mentioned embodiments.That is, various conditions may be applied according to a conditionand/or a need.

Meanwhile, the motion information derived from the L1 reference picturemay also be the same as the L0 input temporal motion information of thecurrent block. Therefore, the encoder and the decoder may also searchthe motion information that is not the same as the L0 input temporalmotion information when they search the motion information to be used asthe final L1 temporal motion information of the current block in the L1reference picture. For example, as in the above-mentioned S1430, in thecase in which the final L1 temporal motion information of the currentblock is derived based on the L1 reference picture, the encoder and thedecoder may use only the motion information different from the L0 inputtemporal motion information of the current block as the final L1temporal motion information. In this case, the encoder and the decodermay also select only motion information having a difference of apredetermined threshold or less from the L0 input temporal motioninformation of the current block as the motion information to be used asthe final L1 temporal motion information. Here, the predeterminedthreshold may be determined based on the mode information of the currentblock, the motion information of the current block, the mode informationof the neighboring block, the motion information of the neighboringblock, and the like, and be determined in various schemes.

In the above-mentioned embodiment, the input temporal motion informationinput to step (S1410) may include an input reference picture index aswell as an input motion vector. Here, the L0 input motion vector and theL1 input motion vector may be a motion vector temporally derived basedon the collocated block as described above, and the L0 input referencepicture index and the L1 input reference picture index may be areference picture index spatially derived from the reconstructedneighboring block. Here, the L0 input reference picture index and the L1input reference picture index may be set to the non-negative smallestvalue among the reference picture indices of the reconstructedneighboring block. Meanwhile, as another example, an L0 input referencepicture index and an L1 input reference picture index may also be set to0 regardless of the motion information of the reconstructed neighboringblock.

In the case in which the L1 input motion vector is reset based on the L1reference picture, the resetting process may also be performed on theinput reference picture index. As an example, the input referencepicture index may be reset based on the reference picture index derivedfrom the L1 reference picture as described above. As another example, inthe case in which the L0 input temporal motion information (for example,the L0 input motion vector, the L0 input reference picture index, andthe like) and L1 input temporal motion information (for example, the L1input motion vector, the L1 input reference picture index, and the like)are the same as each other, the encoder and the decoder may reset bothof the L0 input reference picture index and the L1 input referencepicture index to a value of 0 to use the reset value as final temporalmotion information. The reason is that in the case in which the L0 inputtemporal motion information and the L1 input temporal motion informationare the same as each other, it is likely that both of the L0 referencepicture index and the L1 reference picture index will be 0.

Meanwhile, as described above, the encoder and the decoder may reset thevalue of the L1 input motion vector to the same value as that of themotion vector of the L1 reference picture to derive a final L1 temporalmotion vector. In this case, the motion vector of the L1 referencepicture may also be scaled and used according to the L1 input referencepicture index and/or the reset L1 reference picture index. The L1 inputreference picture index may be used as the final L1 reference pictureindex as it is without being subjected to the resetting process or besubjected to the resetting process and then used as the final L1reference picture index as in the above-mentioned embodiment. Here, areference picture corresponding to the motion vector of the L1 referencepicture and a reference picture indicated by the final L1 referencepicture index may be different from each other. In this case, theencoder and the decoder may perform scaling on the motion vector of theL1 reference picture and use the scaled motion vector as the final L1temporal motion vector of the current block.

In addition, in the above-mentioned embodiments, the reset L1 temporalmotion information may be the same as the L0 temporal motion informationof the current block. Therefore, when the reset L1 temporal motioninformation is the same as the L0 temporal motion information of thecurrent block, the encoder and the decoder may reset the predictiondirection information of the current block to the uni-directionalprediction. In this case, the encoder and the decoder may use only theL0 temporal motion information as the temporal motion information of thecurrent block. This method, which is a combination with theabove-mentioned embodiments, may be applied to the present invention.

FIG. 15 is a block diagram schematically showing an embodiment of aninter prediction apparatus capable of performing the process of derivingtemporal motion information according to the embodiment of FIG. 14. Theinter prediction apparatus according to the embodiment of FIG. 15 mayinclude a temporal motion information judging unit 1510, a motionestimating unit 1520, and an L1 temporal motion information resettingunit 1530.

As described above, the temporal motion information may be derived basedon the motion information of the collocated block corresponding to thecurrent block within the previously reconstructed collocated picture.Here, the collocated picture may correspond to one of reference picturesincluded in a reference picture list as an example. The encoder and thedecoder may determine a predetermined relative position based on theblock present at the spatially same position as that of the currentblock in the collocated picture and derive the collocated block based onthe determined predetermined relative position (for example, thepositions of the inner portion and/or the outer portion of the blockpresent at the spatially same position as that of the current block).The temporal motion information derived based on the collocated blockmay include prediction direction information, an L0 reference picturenumber, an L1 reference picture number, an L0 motion vector, an L1motion vector, and the like.

Referring to FIG. 15, the temporal motion information judging unit 1510may judge whether or not the L0 input temporal motion information andthe L1 input temporal motion information in the input temporal motioninformation are the same as each other, that is, whether or not the L0input reference picture number and the L1 input reference picture numberare the same as each other and the L0 input motion vector and the L1input motion vector are the same as each other.

In the case in which the L0 input temporal motion information and the L1input temporal motion information are not the same as each other, theinter prediction apparatus may use the input temporal motion informationas the temporal motion information of the current block as it is. In thecase in which the AMVP is applied, the temporal motion information ofthe current block may be determined or registered to be a predictionmotion vector candidate for the current block. Further, in the case inwhich the merge is applied, the temporal motion information of thecurrent block may be determined or registered to be a merge candidatefor the current block. In the case in which the L0 input temporal motioninformation and the L1 input temporal motion information are the same aseach other, a process by the motion estimating unit 1520 may beperformed.

Meanwhile, the temporal motion information judging unit 1510 may alsojudge whether or not the L0 input reference picture number and the L1input reference picture number are the same as each other rather thanwhether or not the L0 input temporal motion information and the L1 inputtemporal motion information are the same as each other or a predictiondirection of the collocated block. For example, in the case in which theL0 input reference picture number and the L1 input reference picturenumber are not the same as each other, the input temporal motioninformation may be used as the temporal motion information of thecurrent block as it is, and in the case in which the L0 input referencepicture number and the L1 input reference picture number are the same aseach other, a process by the motion estimating unit 1520 may beperformed. As another example, in the case in which the predictiondirection of the collocated block is the bi-directional prediction, theinput temporal motion information may be used as the temporal motioninformation of the current block as it is, and in the case in which theprediction direction of the collocated block is the uni-directionalprediction, the process by the motion estimating unit 1520 may also beperformed.

Again referring to FIG. 15, in the case in which the L0 input temporalmotion information and the L1 input temporal motion information are thesame as each other, the motion estimating unit 1520 may search or derivethe motion information to be used as the final L1 temporal motioninformation in the L1 reference picture.

As an embodiment, the motion estimating unit 1520 may derive the regionthat is most appropriately matched or similar to the input block (theoriginal block) corresponding to the current block in the L1 referencepicture. In this case, the motion estimating unit 1520 may derive themotion information to be used as the final L1 temporal motioninformation of the current block based on the derived region. As anexample, the motion estimating unit 1520 may derive the motion vector tobe used as the final L1 temporal motion information based on theposition of the block corresponding to the derived region and theposition of the current block and derive the reference picture index(and/or the reference picture number) to be used as the final L1temporal motion information based on the block corresponding to thederived region.

Meanwhile, in the case in which the motion estimating unit 1520corresponds to a component of the encoder, the encoder may also allowthe motion information derived from the L1 reference picture by theabove-mentioned method to be included in the bit stream and betransmitted to the decoder. The motion information derived from the L1reference picture may include the reference picture index, the motionvector, and the like, and the encoder may independently transmit each ofthe reference picture index and the motion vector to the decoder. Inthis case, the encoder may also calculate a difference value between anactual motion vector of the current block and the motion vector derivedfrom the L1 reference picture and then transmit the difference value tothe decoder.

In this case, the decoder may determine the motion information to beused as the final L1 temporal motion information based on thetransmitted motion information. That is, in the case in which the motionestimating unit 1520 corresponds to a component of the decoder, themotion estimating unit 1520 may determine the motion information to beused as the final L1 temporal motion information based on the motioninformation (for example, the motion information transmitted from theencoder) input from the outside.

Again referring to FIG. 15, the L1 temporal motion information resettingunit 1530 may use the motion information derived from the L1 referencepicture as the final L1 temporal motion information of the currentblock. That is, in this case, the L1 temporal motion informationresetting unit 1530 may reset the L1 input temporal motion informationvalue to the motion information value derived by the motion estimatingunit 1520 (the motion information value derived from the L1 referencepicture).

The above-mentioned embodiments of FIGS. 6 to 15 may be individuallyapplied, respectively, or be combined with each other by various methodsaccording to an encoding mode of each block. Hereinafter, in embodimentsto be described below, a block of which an encoding mode is a merge modewill be called a merge block. An example of a block that is not themerge block may include a block of which an encoding mode is an AMVPmode, or the like. Further, in embodiments to be described below, thecurrent block may correspond to one of the merge block and the blockthat is not the merge block according to the case.

As an embodiment, the method of deriving temporal motion informationaccording to the embodiments of FIGS. 6 to 8 may be applied to the mergeblock, and the method of deriving motion information according to theembodiments of FIGS. 12 and 13 may be applied to the block that is notthe merge block. In this case, in the merge block, when the L0 inputtemporal motion information and the L1 input temporal motion informationare the same as each other, the motion information of the reconstructedneighboring block may be used as the final L1 temporal motioninformation of the current block. In addition, in the block that is notthe merge block, the L0 motion information of the current block and theL1 motion information of the current block may be independently set,respectively. As an example, one of the L0 motion information of thecurrent block and the L1 motion information of the current block may bespatially derived based on the reconstructed neighboring block and theother thereof may be temporally derived based on the collocated block.

As another embodiment, the method of deriving temporal motioninformation according to the embodiments of FIGS. 9 to 11 may be appliedto the merge block, and the method of deriving temporal motioninformation according to the embodiments of FIGS. 14 and 15 may beapplied to the block that is not the merge block. In this case, in themerge block, when the L0 input temporal motion information and the L1input temporal motion information are the same as each other, motioninformation of a newly derived collocated block rather than thecollocated block used to derive the input temporal motion informationmay be used as the final L1 temporal motion information of the currentblock. In addition, in the block that is not the merge block, when theL0 input temporal motion information and the L1 input temporal motioninformation are the same as each other, the motion information of the L1reference picture may be used as the final L1 temporal motioninformation of the current block.

As still another embodiment, the method of deriving temporal motioninformation according to the embodiments of FIGS. 6 to 8 may be appliedto the merge block, and the method of deriving temporal motioninformation according to the embodiments of FIGS. 14 and 15 may beapplied to the block that is not the merge block. In this case, in themerge block, when the L0 input temporal motion information and the L1input temporal motion information are the same as each other, the motioninformation of the reconstructed neighboring block may be used as thefinal L1 temporal motion information of the current block. In addition,in the block that is not the merge block, when the L0 input temporalmotion information and the L1 input temporal motion information are thesame as each other, the motion information of the L1 reference picturemay be used as the final L1 temporal motion information of the currentblock.

A combination of the embodiments of FIGS. 6 to 15 is not limited to theabove-mentioned embodiments. That is, various types of combinations ofthe above-mentioned embodiments as well as the above-mentionedembodiments may be provided according to an implementation and/or aneed.

In the above-mentioned embodiments, although the methods have describedbased on a flow chart as a series of steps or blocks, the presentinvention is not limited to a sequence of steps but any step may begenerated in a different sequence or simultaneously from or with othersteps as described above. Further, it may be appreciated by thoseskilled in the art that steps shown in a flow chart is non-exclusive andtherefore, include other steps or deletes one or more steps of a flowchart without having an effect on the scope of the present invention.

The above-mentioned embodiments include examples of various aspects.Although all possible combinations showing various aspects are notdescribed, it may be appreciated by those skilled in the art that othercombinations may be made. Therefore, the present invention should beconstrued as including all other substitutions, alterations andmodifications belong to the following claims.

1. A method for decoding a video signal with an image decoding apparatus, comprising: determining a collocated block comprised in a collocated picture, wherein the collocated picture is a reference picture having the collocated block among reference pictures included in a reference picture list, and wherein the collocated block is determined to be either a first block adjacent to a right-bottom position of a current block or a second block comprising a center position of the current block; obtaining a temporal merge candidate of the current block based on the collocated block, wherein motion information of the temporal merge candidate comprises a motion vector and a reference picture index, and wherein the motion vector of the temporal merge candidate is derived from a motion vector of the collocated block within the collocated picture, and wherein the reference picture index of the temporal merge candidate is set to a predetermined fixed value regardless of a reference picture index of a neighboring block adjacent to the current block; generating a merge candidate list comprising the temporal merge candidate; determining a merge candidate for the current block based on the merge candidate list and a merge candidate index, the merge candidate index specifying one of the merge candidates in the merge candidate list; deriving motion information of the current block from motion information of the determined merge candidate; and generating a prediction block corresponding to the current block based on the derived motion information.
 2. The method for decoding a video signal of claim 1, wherein the collocated block is determined by scanning the first block and the second block in a predetermined order.
 3. The method for decoding a video signal of claim 2, wherein the scanning is performed in sequence of the first block and the second block.
 4. The method for decoding a video signal of claim 1, wherein the predetermined fixed value is
 0. 5. A method for encoding a video signal with an image encoding apparatus, comprising: determining motion information of a current block; generating a prediction block corresponding to the current block; determining a collocated block comprised in a collocated picture, wherein the collocated picture is a reference picture having the collocated block among reference pictures included in a reference picture list, and wherein the collocated block is determined to be either a first block adjacent to a right-bottom position of the current block or a second block comprising a center position of the current block; obtaining a temporal merge candidate of the current block based on the collocated block, wherein motion information of the temporal merge candidate comprises a motion vector and a reference picture index, and wherein the motion vector of the temporal merge candidate is derived from a motion vector of the collocated block within the collocated picture, and wherein the reference picture index of the temporal merge candidate is set to a predetermined fixed value regardless of a reference picture index of a neighboring block adjacent to the current block; generating a merge candidate list comprising the temporal merge candidate; and encoding the motion information of the current block based on the generated merge candidate list.
 6. The method for encoding a video signal of claim 5, wherein the predetermined fixed value is
 0. 7. A non-transitory computer-readable recording medium storing a bitstream, wherein the bitstream is generated by a method for encoding a video signal, the method comprising: determining motion information of a current block; generating a prediction block corresponding to the current block by performing motion compensation on the current block; determining a collocated block comprised in a collocated picture, wherein the collocated picture is a reference picture having the collocated block among reference pictures included in a reference picture list, and wherein the collocated block is determined to be either a first block adjacent to a right-bottom position of a current block or a second block comprising a center position of the current block; obtaining a temporal merge candidate of the current block based on the collocated block, wherein motion information of the temporal merge candidate comprises a motion vector and a reference picture index, and wherein the motion vector of the temporal merge candidate is derived from a motion vector of the collocated block within the collocated picture, and wherein the reference picture index of the temporal merge candidate is set to a predetermined fixed value regardless of a reference picture index of a neighboring block adjacent to the current block; generating a merge candidate list comprising the temporal merge candidate; and encoding motion information of the current block based on the generated merge candidate list.
 8. The non-transitory computer-readable recording medium of claim 7, wherein the predetermined fixed value is
 0. 